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 URL matching #562

Merged
merged 1 commit into from
May 6, 2024
Merged

Fix URL matching #562

merged 1 commit into from
May 6, 2024

Conversation

BelKed
Copy link
Contributor

@BelKed BelKed commented May 6, 2024

This PR addresses an issue in theme switching functionality. Previously, the theme switcher was not correctly removing the link to the dark theme CSS file due to a mismatch between absolute and relative URLs.

The issue arose because when setting themeLink.href = '/dark.css';, the browser automatically converted this relative URL to an absolute URL, which includes the protocol and domain. As a result, themeLink.href became http://localhost:5600/dark.css instead of the expected /dark.css.

To resolve this, I've updated the code to use the URL object to extract the pathname (the relative URL) from themeLink.href. This ensures that we're correctly targeting the link element to remove when switching themes.


🚀 This description was created by Ellipsis for commit af16694

Summary:

This PR fixes the theme switching by using the URL object to correctly target the link element for removal in Theme.vue.

Key points:

  • Fixes theme switching in Theme.vue
  • Uses URL object to parse themeLink.href
  • Correctly targets link element for removal

Generated with ❤️ by ellipsis.dev

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to af16694 in 29 seconds

More details
  • Looked at 14 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 additional comments because they didn't meet confidence threshold of 50%.

Workflow ID: wflow_ooky3qq3mVbl2aOU


You can customize Ellipsis with review rules, user-specific overrides, quiet mode, and more. See docs.

13 days left in your free trial, upgrade for $20/seat/month or contact us.

Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 25.60%. Comparing base (14043b2) to head (af16694).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #562   +/-   ##
=======================================
  Coverage   25.60%   25.60%           
=======================================
  Files          27       27           
  Lines        1613     1613           
  Branches      281      286    +5     
=======================================
  Hits          413      413           
- Misses       1141     1174   +33     
+ Partials       59       26   -33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ErikBjare ErikBjare merged commit b54b5cb into ActivityWatch:master May 6, 2024
8 checks passed
@BelKed BelKed deleted the fix-url-matching branch May 6, 2024 19:42
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.

2 participants