Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/#359 - Redirect to '/dashboard' on computer when shrinking from '/list' on mobile #5305

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Logorrheique
Copy link

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

The changes are fixing the issues #359 .
The bug is when a user use the mobile interface and go '/list' then shrinking or switch to computer size, there is a duplication of monitoring component.
I setup a redirection when the user shrink/switch to computer to /dashboard
Fixes #(issue)
#359

Type of change

Please delete any options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • User interface (UI)
  • Breaking change (a fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods)
  • My changes generates no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

2024-10-27.11-53-50.mp4

@Logorrheique Logorrheique changed the title Fix/#359 Fix/#359 - Redirect to '/dashboard' on computer when shrinking from '/list' on mobile Nov 4, 2024
@Logorrheique
Copy link
Author

@CommanderStorm Gentle ping ^^

watch: {
"$root.isMobile"(newVal) {
if (!newVal && this.$route.path === "/list") {
this.$router.push("/dashboard");
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest you tu use replace instead of push. You'll avoid having the /list and the /dashboard in the browser history (you'll instead only have /dashboard).

this.$router.replace({ path: "/new_path" })

Doc: https://router.vuejs.org/guide/essentials/navigation.html#Replace-current-location

Copy link
Author

Choose a reason for hiding this comment

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

Thanks !

},
mounted() {
if (!this.$root.isMobile && this.$route.path === "/list") {
this.$router.push("/dashboard");
Copy link
Contributor

Choose a reason for hiding this comment

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

Same than before!

@Logorrheique Logorrheique marked this pull request as ready for review November 18, 2024 09:26
@Logorrheique
Copy link
Author

@CommanderStorm Hi, the PR is ready !

@CommanderStorm CommanderStorm added this to the 2.1.0 milestone Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants