2019-09-18 13:52:39 -04:00
|
|
|
import React from "react";
|
|
|
|
import ReactDOM from "react-dom";
|
|
|
|
import App from "./App";
|
|
|
|
import { HashRouter } from "react-router-dom";
|
|
|
|
import * as serviceWorker from "./serviceWorker";
|
|
|
|
import { createUserDefaults, getConfig } from "./utilities/settings";
|
|
|
|
import { collectEmojisFromServer } from "./utilities/emojis";
|
|
|
|
import { SnackbarProvider } from "notistack";
|
|
|
|
import { userLoggedIn, refreshUserAccountData } from "./utilities/accounts";
|
2019-04-07 17:25:39 -04:00
|
|
|
|
2019-09-18 13:52:39 -04:00
|
|
|
getConfig()
|
|
|
|
.then((config: any) => {
|
|
|
|
document.title = config.branding.name || "Hyperspace";
|
|
|
|
})
|
|
|
|
.catch((err: Error) => {
|
|
|
|
console.error(err);
|
|
|
|
});
|
2019-03-27 17:39:25 -04:00
|
|
|
|
|
|
|
createUserDefaults();
|
2019-04-07 17:25:39 -04:00
|
|
|
if (userLoggedIn()) {
|
|
|
|
collectEmojisFromServer();
|
|
|
|
refreshUserAccountData();
|
|
|
|
}
|
2019-03-25 15:53:33 -04:00
|
|
|
|
2019-03-25 17:01:39 -04:00
|
|
|
ReactDOM.render(
|
|
|
|
<HashRouter>
|
2019-03-30 17:13:49 -04:00
|
|
|
<SnackbarProvider
|
|
|
|
anchorOrigin={{
|
2019-09-18 13:52:39 -04:00
|
|
|
vertical: "bottom",
|
|
|
|
horizontal: "left"
|
2019-03-30 17:13:49 -04:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
<App />
|
|
|
|
</SnackbarProvider>
|
2019-09-18 13:52:39 -04:00
|
|
|
</HashRouter>,
|
|
|
|
document.getElementById("root")
|
|
|
|
);
|
2019-03-30 17:13:49 -04:00
|
|
|
|
2019-03-25 15:53:33 -04:00
|
|
|
// If you want your app to work offline and load faster, you can change
|
|
|
|
// unregister() to register() below. Note this comes with some pitfalls.
|
|
|
|
// Learn more about service workers: https://bit.ly/CRA-PWA
|
|
|
|
serviceWorker.unregister();
|