Fix not loading settings first page anymore#4365
Conversation
📝 WalkthroughWalkthroughSettings.vue now treats undefined incoming ChangesSettings component tab initialization
Docker production stage package
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
resources/js/views/admin/Settings.vue (1)
223-226:⚠️ Potential issue | 🟠 Major | ⚡ Quick winKeep tab fallback consistent in the route watcher.
tabis normalized to""at initialization, but the watcher can set it back toundefined. That can break thetab === ""branch and regress first-page rendering when navigating to the route without atabparam.Suggested fix
watch( () => route.params.tab, (newTab, _oldTab) => { - tab.value = newTab as string | undefined; + tab.value = (newTab as string | undefined) ?? ""; }, );
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7a76e206-6bc9-496e-9781-903287534392
📒 Files selected for processing (1)
resources/js/views/admin/Settings.vue
There was a problem hiding this comment.
🧹 Nitpick comments (1)
resources/js/views/admin/Settings.vue (1)
225-225: ⚡ Quick winConsider defensive handling for route parameter type safety.
The type assertion
(newTab as string|undefined)doesn't account for all possible types fromroute.params.tab, which can bestring | string[] | null | undefinedin vue-router 5.x. While your router.push calls always use single strings (making an array unlikely), defensive code would be safer:- tab.value = (newTab as string|undefined) ?? ''; + tab.value = (Array.isArray(newTab) ? newTab[0] : newTab) ?? '';Additionally, TypeScript convention uses spaces around the union operator:
string | undefined.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bdf98573-1008-4fdf-8e5b-0e111c6ed708
📒 Files selected for processing (2)
Dockerfileresources/js/views/admin/Settings.vue
Summary by CodeRabbit