mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-22 00:06:16 +08:00
showing offline mode reason on localhost
This commit is contained in:
parent
44e675bc77
commit
9340f9bedc
|
@ -11,12 +11,19 @@ export let Auth: AuthType | undefined;
|
|||
try {
|
||||
app = initializeApp(firebaseConfig);
|
||||
Auth = getAuth(app);
|
||||
// throw new Error("Firebase is not initialized");
|
||||
throw new Error("Firebase is not initialized");
|
||||
} catch (e) {
|
||||
app = undefined;
|
||||
Auth = undefined;
|
||||
console.error(e);
|
||||
Notifications.addBanner("Offline mode", 0, undefined, true);
|
||||
const error = e as Error;
|
||||
Notifications.addBanner(
|
||||
"Offline mode: " +
|
||||
(window.location.hostname === "localhost" ? error.message : ""),
|
||||
0,
|
||||
undefined,
|
||||
true
|
||||
);
|
||||
// $("body").text(
|
||||
// "Failed to initialize Firebase. Are you sure you have the correct config in the firebase-config.ts file?"
|
||||
// );
|
||||
|
|
Loading…
Reference in a new issue