enhancement(web): improve functionality of utility components (#1094)

added missing Buffer definition for Stacktracey, made date functions more robust against undefined values

enhancement: made simplifyDate and IsEmptyDate prone against undefined values
fix: added a global Buffer definition (apparently required by Stacktracey)
This commit is contained in:
stacksmash76 2023-09-09 23:02:54 +02:00 committed by GitHub
parent 087471a1f7
commit 64f81a4614
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 6 deletions

View file

@ -5,6 +5,7 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { Buffer } from "buffer";
import "@fontsource-variable/inter";
import "./index.css";
@ -18,6 +19,9 @@ declare global {
}
window.APP = window.APP || {};
// Apparently Stacktracey requires this for some weird reason
// (at least in local dev env)
window.Buffer = Buffer;
// Initializes auth and theme contexts
InitializeGlobalContext();
@ -28,4 +32,4 @@ root.render(
<StrictMode>
<App />
</StrictMode>
);
);