Skip to content

Fixed slash command popup #184#185

Merged
lostdesign merged 2 commits intolostdesign:masterfrom
CarlosPovedaC:bugfix/#184-slash-problem
Oct 9, 2022
Merged

Fixed slash command popup #184#185
lostdesign merged 2 commits intolostdesign:masterfrom
CarlosPovedaC:bugfix/#184-slash-problem

Conversation

@CarlosPovedaC
Copy link

Issue #184 solved.

Bug description:

When you do a clean installation for devs, slash command popups doesn't show.

Fix description:

The problem is that variable localstorage.lang hasn't a default value so if you don't pick a language in the dropdown menu of the application settings the slash popups doesn't appears.

The "locale" variable had the default value, but was never used because the variable "localStorage.lang" was being assigned instead, so we just change "loaclStorage.lang" for "this.locale".

  • Before fix:

Captura de Pantalla 2022-10-09 a las 12 49 11

  • After fix:

Captura de Pantalla 2022-10-09 a las 12 52 00

Bug due to the variable localStorage.lang doesn't have a default value
export const Translations = {
locale: localStorage.lang ?? 'de-DE',
translationStrings: import(`./locales/${localStorage.lang}.json`),
translationStrings: import(`./locales/${this.locale}.json`),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.locale may not be always set upon startup - while it does not noticeably break the app, it still throws an error.

Could you change

locale: localStorage.lang ?? 'de-DE',
translationStrings: import(`./locales/${this.locale}.json`),

to

locale: localStorage.lang ?? 'en-US',
translationStrings: import(`./locales/${this.locale || 'en-US'}.json`),

@lostdesign lostdesign merged commit ee9dfea into lostdesign:master Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants