Fix bug '[Login page] The default wekan logo appears briefly before displaying the custom logo #3830'

This commit is contained in:
Emile NDAGIJIMANA 2021-05-31 15:36:57 +02:00
parent 46e881bea3
commit 5b08ae12a6
2 changed files with 8 additions and 4 deletions

View file

@ -34,8 +34,9 @@ template(name="userFormsLayout")
img(src="{{currentSetting.customLoginLogoImageUrl}}" width="300" height="auto") img(src="{{currentSetting.customLoginLogoImageUrl}}" width="300" height="auto")
br br
unless currentSetting.customLoginLogoImageUrl unless currentSetting.customLoginLogoImageUrl
img(src="{{pathFor '/wekan-logo.svg'}}" alt="" width="300" height="auto") if isSettingDatabaseFctCallDone
br img(src="{{pathFor '/wekan-logo.svg'}}" alt="" width="300" height="auto")
br
if currentSetting.textBelowCustomLoginLogo if currentSetting.textBelowCustomLoginLogo
+viewer +viewer
| {{currentSetting.textBelowCustomLoginLogo}} | {{currentSetting.textBelowCustomLoginLogo}}

View file

@ -19,7 +19,7 @@ const validator = {
return true; return true;
}, },
}; };
let isSettingDatabaseFctCallDone = false;
Template.userFormsLayout.onCreated(function() { Template.userFormsLayout.onCreated(function() {
const templateInstance = this; const templateInstance = this;
templateInstance.currentSetting = new ReactiveVar(); templateInstance.currentSetting = new ReactiveVar();
@ -28,6 +28,7 @@ Template.userFormsLayout.onCreated(function() {
Meteor.subscribe('setting', { Meteor.subscribe('setting', {
onReady() { onReady() {
templateInstance.currentSetting.set(Settings.findOne()); templateInstance.currentSetting.set(Settings.findOne());
isSettingDatabaseFctCallDone = true;
return this.stop(); return this.stop();
}, },
}); });
@ -55,7 +56,9 @@ Template.userFormsLayout.helpers({
currentSetting() { currentSetting() {
return Template.instance().currentSetting.get(); return Template.instance().currentSetting.get();
}, },
isSettingDatabaseCallDone(){
return isSettingDatabaseFctCallDone;
},
isLoading() { isLoading() {
return Template.instance().isLoading.get(); return Template.instance().isLoading.get();
}, },