[Bug]: going to control panel multiple times doesn't replace route #9770

Closed
opened 2 months ago by thatonecalculator · 4 comments

What happened?

If you click between, for example, home and control panel, the first click to control panel will correctly replace '/admin' with '/admin/overview', but all subsequent visits will not until a page reload. Likely related to #9731, so I'm pinging @naskya

What did you expect to happen?

Clicking on Control Panel (which leads to '/admin' initially) should redirect to '/admin/overview' every time:

packages/client/src/pages/admin/index.vue:

watch(router.currentRef, (to) => {
	if (to.route.path === "/admin" && to.child?.route.name == null && !narrow) {
		router.replace('/admin/overview');
	}
});

Version

v13.2.0-dev15

Instance

stop.voring.me

What browser are you using?

Firefox

Relevant log output

No console errors

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines
### What happened? If you click between, for example, home and control panel, the first click to control panel will correctly replace '/admin' with '/admin/overview', but all subsequent visits will not until a page reload. Likely related to #9731, so I'm pinging @naskya ### What did you expect to happen? Clicking on Control Panel (which leads to '/admin' initially) should redirect to '/admin/overview' every time: `packages/client/src/pages/admin/index.vue`: ```js watch(router.currentRef, (to) => { if (to.route.path === "/admin" && to.child?.route.name == null && !narrow) { router.replace('/admin/overview'); } }); ``` ### Version v13.2.0-dev15 ### Instance stop.voring.me ### What browser are you using? Firefox ### Relevant log output ```shell No console errors ``` ### Contribution Guidelines - [x] I agree to follow this project's Contribution Guidelines
thatonecalculator changed title from [Bug]: clicking between control panel and other page multiple times doesn't properly replace router from '/admin' to '/admin/overview' to [Bug]: going to control panel multiple times doesn't replace route 2 months ago
naskya referenced this issue from a commit 2 months ago

I think narrow isn't correctly determined in admin/index.vue, and !narrow (included in the code you pasted) prevents us from getting into the if block.

I don't know if this is a proper way to do it, but at least I could fix this behavior by making the process similar to settings/index.vue (commit 713505821d).

I think `narrow` isn't correctly determined in `admin/index.vue`, and `!narrow` (included in the code you pasted) prevents us from getting into the if block. I don't know if this is a proper way to do it, but at least I could fix this behavior by making the process similar to `settings/index.vue` (commit https://codeberg.org/naskya/calckey/commit/713505821d74a41745c0a44a48b7d73f7c2e7e97).
panos added the
🐛Bug
label 2 months ago

The admin page and settings page has a similar structure, but the logic on the code looks a bit different (especially what I modified in that commit). I feel this is weird, but I don't know if it should be fixed (is it on purpose? if so, I don't want to break it). This is also the case for Misskey, btw.

I can create a pull request if you want to merge this.

The admin page and settings page has a similar structure, but the logic on the code looks a bit different (especially what I modified in that commit). I feel this is weird, but I don't know if it should be fixed (is it on purpose? if so, I don't want to break it). This is also the case for Misskey, btw. I can create a pull request if you want to merge this.
Poster
Owner

you can pr it and we'll discuss from there :)

you can pr it and we'll discuss from there :)
naskya referenced this issue from a commit 2 months ago

@thatonecalculator Did you forget to close this or intentionally leave this open?

@thatonecalculator Did you forget to close this or intentionally leave this open?
thatonecalculator closed this issue 2 months ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: calckey/calckey#9770
Loading…
There is no content yet.