Loading Gist

This commit is contained in:
Sidharth Vinod
2021-06-05 15:31:22 +05:30
parent aed37c19c7
commit cc3f4fabc2
8 changed files with 125 additions and 12 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import type { State } from '$lib/types';
import { initURLSubscription, loadState, updateCodeStore } from './state';
import { analytics, initAnalytics } from './stats';
import { loadDataFromUrl } from './fileLoaders/loader';
import { initLoading } from './loading';
export const loadStateFromURL = (): void => {
loadState(window.location.hash.slice(1));
@@ -15,7 +16,7 @@ export const syncDiagram = (): void => {
export const initHandler = async (): Promise<void> => {
loadStateFromURL();
await loadDataFromUrl().catch(console.error);
await initLoading('Loading Gist...', loadDataFromUrl().catch(console.error));
syncDiagram();
initURLSubscription();
await initAnalytics();