mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Fix settings initialisation (#6750)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
parent
d30bd7e501
commit
27d995066b
|
@ -101,13 +101,18 @@ export default defineComponent({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
postAuthenticateDone: false,
|
postAuthenticateDone: false,
|
||||||
|
settingsInitialised: false,
|
||||||
loading: true,
|
loading: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async initSettings(): Promise<void> {
|
async initSettings(): Promise<void> {
|
||||||
|
// The settings should only be initialized once
|
||||||
|
if (this.settingsInitialised) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.settingsStore.getSettings();
|
await this.settingsStore.getSettings();
|
||||||
|
this.settingsInitialised = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.showToast({
|
this.showToast({
|
||||||
title: this.$locale.baseText('startupError'),
|
title: this.$locale.baseText('startupError'),
|
||||||
|
@ -139,7 +144,6 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async initialize(): Promise<void> {
|
async initialize(): Promise<void> {
|
||||||
await this.initSettings();
|
|
||||||
await Promise.all([this.loginWithCookie(), this.initTemplates()]);
|
await Promise.all([this.loginWithCookie(), this.initTemplates()]);
|
||||||
},
|
},
|
||||||
trackPage(): void {
|
trackPage(): void {
|
||||||
|
@ -279,7 +283,8 @@ export default defineComponent({
|
||||||
void this.postAuthenticate();
|
void this.postAuthenticate();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
$route(route) {
|
async $route(route) {
|
||||||
|
await this.initSettings();
|
||||||
this.authenticate();
|
this.authenticate();
|
||||||
this.redirectIfNecessary();
|
this.redirectIfNecessary();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue