Skip to content

Build your personal knowledge base with Trilium Notes

hide loader only once the initial note is loaded

azivner43a6a52eadf9
diff --git a/public/javascripts/init.js b/public/javascripts/init.js
index cc74a72bfa..a973ae93cf 100644
--- a/public/javascripts/init.js
+++ b/public/javascripts/init.js
@@ -91,16 +91,23 @@ function isElectron() {
return window && window.process && window.process.type;
}
-$(document).ready(() => {
- $("#container").show();
-
- // Get a reference to the loader's div
- const loaderDiv = document.getElementById("loader-wrapper");
- // When the transition ends remove loader's div from display
- // so that we can access the map with gestures or clicks
- loaderDiv.addEventListener("transitionend", function(){
- loaderDiv.style.display = "none";
- }, true);
- // Kick off the CSS transition
- loaderDiv.style.opacity = 0.0;
-});
\ No newline at end of file
+let appShown = false;
+
+function showAppIfHidden() {
+ if (!appShown) {
+ appShown = true;
+
+ $("#container").show();
+
+ // Get a reference to the loader's div
+ const loaderDiv = document.getElementById("loader-wrapper");
+ // When the transition ends remove loader's div from display
+ // so that we can access the map with gestures or clicks
+ loaderDiv.addEventListener("transitionend", function(){
+ loaderDiv.style.display = "none";
+ }, true);
+
+ // Kick off the CSS transition
+ loaderDiv.style.opacity = 0.0;
+ }
+}
\ No newline at end of file
diff --git a/public/javascripts/note_editor.js b/public/javascripts/note_editor.js
index 20a2f054bd..213a11e068 100644
--- a/public/javascripts/note_editor.js
+++ b/public/javascripts/note_editor.js
@@ -227,6 +227,8 @@ const noteEditor = (function() {
noteChangeDisabled = false;
setNoteBackgroundIfEncrypted(currentNote);
+
+ showAppIfHidden();
}
async function loadNote(noteId) {