mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-26 10:12:59 +01:00
feature (loadspeed): shave a couple ms from load time
This commit is contained in:
parent
aea5150e43
commit
a18d17490c
3 changed files with 5 additions and 3 deletions
|
|
@ -4,6 +4,7 @@ import { init as setup_translation } from "../locales/index.js";
|
|||
import { init as setup_config } from "../model/config.js";
|
||||
import { init as setup_plugin } from "../model/plugin.js";
|
||||
import { init as setup_chromecast } from "../model/chromecast.js";
|
||||
import { init as setup_cache } from "../pages/filespage/cache.js";
|
||||
import { report } from "../helpers/log.js";
|
||||
import { $error } from "./common.js";
|
||||
|
||||
|
|
@ -22,6 +23,7 @@ export default async function main() {
|
|||
setup_history(),
|
||||
setup_polyfill(),
|
||||
setup_plugin(),
|
||||
setup_cache(),
|
||||
]);
|
||||
window.dispatchEvent(new window.Event("pagechange"));
|
||||
} catch (err) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import componentFilesystem, { init as initFilesystem } from "./filespage/ctrl_fi
|
|||
import componentSubmenu, { init as initSubmenu } from "./filespage/ctrl_submenu.js";
|
||||
import componentNewItem, { init as initNewItem } from "./filespage/ctrl_newitem.js";
|
||||
import componentUpload, { init as initUpload } from "./filespage/ctrl_upload.js";
|
||||
import { init as initCache } from "./filespage/cache.js";
|
||||
import { init as initState } from "./filespage/state_config.js";
|
||||
import { init as initThing } from "./filespage/thing.js";
|
||||
|
||||
|
|
@ -46,7 +45,7 @@ export default WithShell(function(render) {
|
|||
export function init() {
|
||||
return Promise.all([
|
||||
loadCSS(import.meta.url, "ctrl_filespage.css"),
|
||||
initShell(), initFilesystem(), initCache(),
|
||||
initShell(), initFilesystem(),
|
||||
initSubmenu(), initNewItem(), initUpload(),
|
||||
initState(), initThing(),
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import assert from "../../lib/assert.js";
|
||||
import { getSession } from "../../model/session.js";
|
||||
import { onLogout } from "../ctrl_logout.js";
|
||||
|
||||
class ICache {
|
||||
/**
|
||||
|
|
@ -238,10 +239,10 @@ export async function init() {
|
|||
try {
|
||||
const session = await getSession().toPromise();
|
||||
backendID = session.backendID;
|
||||
onLogout(() => backendID = "");
|
||||
} catch (err) {}
|
||||
}
|
||||
};
|
||||
|
||||
return Promise.all([setup_cache(), setup_session()]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue