Skip to content
Snippets Groups Projects

Add basic preloading for nodeinfo/config

Merged Shpuld Shpludson requested to merge feat/preload-data-from-html into develop
1 unresolved thread
+ 6
5
@@ -25,11 +25,11 @@ const preloadFetch = async (request) => {
if (!data || !data[request]) {
return window.fetch(request)
}
const requestJson = atob(data[request])
const requestData = atob(data[request])
return {
ok: true,
json: () => JSON.parse(requestJson),
text: () => requestJson
json: () => JSON.parse(requestData),
text: () => requestData
}
}
@@ -340,17 +340,18 @@ const afterStoreSetup = async ({ store, i18n }) => {
}
// Now we can try getting the server settings and logging in
// Most of these are preloaded into the index.html so blocking is minimized
await Promise.all([
checkOAuthToken({ store }),
getTOS({ store }),
getInstancePanel({ store }),
getStickers({ store }),
getNodeInfo({ store }),
getInstanceConfig({ store })
])
// Start fetching things that don't need to block the UI
store.dispatch('fetchMutes')
getTOS({ store })
getStickers({ store })
const router = new VueRouter({
mode: 'history',
Loading