mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-21 22:54:53 +08:00
Reduce Scripts needed on start up to reduce critical requests aka speed up initial loading
This commit is contained in:
@@ -7,17 +7,19 @@ class PairDrop {
|
||||
this.$headerNotificationButton = $('notification');
|
||||
this.$editPairedDevicesHeaderBtn = $('edit-paired-devices');
|
||||
this.$footerInstructionsPairedDevices = $$('.discovery-wrapper .badge-room-secret');
|
||||
|
||||
this.$head = $$('head');
|
||||
|
||||
this.$installBtn = $('install');
|
||||
|
||||
this.registerServiceWorker();
|
||||
|
||||
Events.on('beforeinstallprompt', e => this.onPwaInstallable(e));
|
||||
|
||||
const persistentStorage = new PersistentStorage();
|
||||
const themeUI = new ThemeUI();
|
||||
const backgroundCanvas = new BackgroundCanvas();
|
||||
|
||||
Events.on('initial-translation-loaded', _ => {
|
||||
const backgroundCanvas = new BackgroundCanvas();
|
||||
// FooterUI needs translations
|
||||
const footerUI = new FooterUI();
|
||||
|
||||
Events.on('fade-in-ui', _ => this.fadeInUI())
|
||||
@@ -29,6 +31,9 @@ class PairDrop {
|
||||
// Load deferred assets
|
||||
this.loadDeferredAssets();
|
||||
});
|
||||
|
||||
// Translate page -> fires 'initial-translation-loaded' on finish
|
||||
const localization = new Localization();
|
||||
}
|
||||
|
||||
registerServiceWorker() {
|
||||
@@ -171,6 +176,4 @@ class PairDrop {
|
||||
}
|
||||
}
|
||||
|
||||
const persistentStorage = new PersistentStorage();
|
||||
const pairDrop = new PairDrop();
|
||||
const localization = new Localization();
|
||||
const pairDrop = new PairDrop();
|
||||
Reference in New Issue
Block a user