waffle/frontend/src/main.js

24 lines
639 B
JavaScript
Raw Normal View History

2022-04-28 18:48:44 +03:00
import Main from './components/Main.svelte';
2022-05-05 16:31:10 +03:00
import { getItem, init } from './storage';
import { authWithToken, useAuthHandlers } from './auth';
import { initResponsiveHandlers } from './responsive';
2022-05-05 21:49:25 +03:00
import { useDebuggingApi } from './debuggingapi';
2022-05-05 16:31:10 +03:00
init();
2022-05-05 21:49:25 +03:00
useDebuggingApi();
initResponsiveHandlers();
useAuthHandlers();
authWithToken(getItem("auth:token"));
2022-04-14 00:31:03 +03:00
// Remove loading screen
const loadingElement = document.getElementById("pre--loading-screen");
if (loadingElement) {
loadingElement.parentElement.removeChild(loadingElement);
}
2022-04-28 18:48:44 +03:00
const app = new Main({
2022-04-14 00:31:03 +03:00
target: document.body
});
2022-05-05 21:49:25 +03:00
window.__waffle.app = app;
2022-04-14 00:31:03 +03:00
export default app;