Sidebar doesn't hide on navigation on non-English languages on mobile #2020
Labels
No Label
dependencies
duplicate
help wanted
invalid
kind/bug
kind/feature
needs reproduction
question
security
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/vikunja#2020
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
How to reproduce:
/user/settings/general
The sidebar didn't close, as it would on English.
That is, this line doesn't work when the language is not
DEFAULT_LANGUAGE
:1b06112db4/src/composables/useMenuActive.ts (L38)
It's a race condition. For non-English languages
setLanguage
doesn't return an immediately resolved promise because it has to import the lang:373b04bd58/src/i18n/index.ts (L47-L49)
setLanguage
is called here:4be53b098c/src/main.ts (L110-L112)
Which results in
useMenuActive
getting executed before the app has been mounted, resulting inuseRoute
returningundefined
here:1b06112db4/src/composables/useMenuActive.ts (L19)
This also completely breaks the app in dev mode (this is how I discovered it, in fact).
Vikunja Frontend Version
0eb78e32
Vikunja API Version
v0.20.1+150-4f62e978ef
Browser and version
No response
Can you reproduce the bug on the Vikunja demo site?
Yes
Screenshots
No response
Huh. Very interesting find. I was able to reproduce this but had to reload the window, it seems to work fine immediately after changing the language. Thanks for all the debug info!
Basically, once we fix the promise return here to make sure it always only returns when the language is fully loaded it should work?
Or maybe we can fix the route watcher? Why does that actually return undefined when the language is not loaded? Aren't these two completely separate parts?
Right, forgot to mention that.
Not sure what you mean. Isn't it the case now?
I think it's about the app not being mounted.
useRoute
warns (in dev build)I thought this is the case but it looks like it isn't? Didn't properly debug this yet.
Put up a PR: vikunja/frontend#3218