From 9d34c90b9a5ebbae73cbec28a25485b4027fadfd Mon Sep 17 00:00:00 2001 From: Zack Brody Date: Mon, 18 Oct 2021 12:20:38 -0700 Subject: [PATCH] Fix Date Label In Crashes Plugin Summary: The date type for crash reports was updated in D29327501 (https://github.com/facebook/flipper/commit/aff02b2ca12b94e1a63dfcf9b8a516f5554e8c11) from `Date` to `number`. Unset values were previously `null` but became `NaN` in this change. `NaN` is nonnull so the backup value of `Date.now()` was not getting triggered properly and leading to "Invalid Date" to show up in the UI. Reviewed By: passy Differential Revision: D31702757 fbshipit-source-id: da93b1f79eb633b2f49dcffbe680d56d47a23ea0 --- desktop/plugins/public/crash_reporter/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/plugins/public/crash_reporter/index.tsx b/desktop/plugins/public/crash_reporter/index.tsx index 774e35ee8..bb35c68de 100644 --- a/desktop/plugins/public/crash_reporter/index.tsx +++ b/desktop/plugins/public/crash_reporter/index.tsx @@ -47,7 +47,7 @@ export function devicePlugin(client: DevicePluginClient) { callstack: payload.callstack, name: payload.name, reason: payload.reason, - date: payload.date ?? Date.now(), + date: payload.date || Date.now(), }; crashes.update((draft) => {