mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
⚡ Prevent race condition with headers
This commit is contained in:
parent
d2c79d3ef0
commit
e22febb3f3
|
@ -240,9 +240,6 @@ export default mixins(
|
||||||
// TODO i18n: Remove next line
|
// TODO i18n: Remove next line
|
||||||
console.log(`Switching locale from ${oldLocale} to ${newLocale}`); // eslint-disable-line no-console
|
console.log(`Switching locale from ${oldLocale} to ${newLocale}`); // eslint-disable-line no-console
|
||||||
loadLanguage(newLocale);
|
loadLanguage(newLocale);
|
||||||
|
|
||||||
const headers = await this.restApi().getNodeTranslationHeaders();
|
|
||||||
addHeaders(headers, this.$store.getters.defaultLocale);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async beforeRouteLeave(to, from, next) {
|
async beforeRouteLeave(to, from, next) {
|
||||||
|
@ -2569,6 +2566,11 @@ export default mixins(
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await Promise.all(loadPromises);
|
await Promise.all(loadPromises);
|
||||||
|
|
||||||
|
if (this.defaultLocale !== 'en') {
|
||||||
|
const headers = await this.restApi().getNodeTranslationHeaders();
|
||||||
|
addHeaders(headers, this.defaultLocale);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$showError(
|
this.$showError(
|
||||||
error,
|
error,
|
||||||
|
|
Loading…
Reference in a new issue