Change internal storage to number instead of Date

Summary: per title, for reasons see next diff :)

Reviewed By: passy

Differential Revision: D29327501

fbshipit-source-id: 548d943e90769af478232d3031d916fb399a067a
This commit is contained in:
Michel Weststrate
2021-06-29 08:02:53 -07:00
committed by Facebook GitHub Bot
parent d02c560150
commit aff02b2ca1
5 changed files with 24 additions and 18 deletions

View File

@@ -18,14 +18,14 @@ export type Crash = {
callstack?: string;
reason: string;
name: string;
date: Date;
date: number;
};
export type CrashLog = {
callstack: string;
reason: string;
name: string;
date?: Date | null;
date?: number;
};
export function devicePlugin(client: DevicePluginClient) {
@@ -39,7 +39,7 @@ export function devicePlugin(client: DevicePluginClient) {
selectedCrash.set(crashId as string);
});
function reportCrash(payload: CrashLog | Crash) {
function reportCrash(payload: CrashLog) {
notificationID++;
const crash = {
@@ -47,7 +47,7 @@ export function devicePlugin(client: DevicePluginClient) {
callstack: payload.callstack,
name: payload.name,
reason: payload.reason,
date: payload.date || new Date(),
date: payload.date ?? Date.now(),
};
crashes.update((draft) => {