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

refactor: Wire up Tauri listeners in onMount of root layout #322

Merged
merged 4 commits into from
Aug 28, 2024

Conversation

maiertech
Copy link
Member

@maiertech maiertech commented Aug 6, 2024

Description of change

Since #246 popped up twice recently, this PR refactors how the backend state is passed into the frontend state.

Instead of wiring Tauri listeners up when corresponding states get their first subscriber, now the listeners are wired up in the onMount of the root layout. This is the only component that is guaranteed to exist at any time while UniMe is open.

It's not clear if this will fix #246. If nothing else, this refactoring makes it cleaner and easier to understand where the Tauri listeners are wired up.

Links to any relevant issues

How the change has been tested

  • Testing if Wrong route gets served #246 has been fixed would only be possible by merging into dev and observing over a longer period if Wrong route gets served #246 occurs again.
  • Reviewers need to do spot checks on different routes in the app to test if it works as expected. Also an error should be triggered to test the error toast.

Definition of Done checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@maiertech maiertech self-assigned this Aug 6, 2024
@maiertech maiertech linked an issue Aug 6, 2024 that may be closed by this pull request
@maiertech maiertech changed the title Maiertech/issue246 refactor: Wire up Tauri listeners in onMount of root layout Aug 6, 2024
@maiertech maiertech marked this pull request as ready for review August 21, 2024 08:20
Copy link
Collaborator

@daniel-mader daniel-mader left a comment

Choose a reason for hiding this comment

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

Great refactoring! 👍

unime/src/lib/stores.ts Outdated Show resolved Hide resolved
unime/src/lib/stores.ts Outdated Show resolved Hide resolved
@maiertech maiertech merged commit 2b5590e into dev Aug 28, 2024
3 checks passed
@maiertech maiertech deleted the maiertech/issue246 branch August 28, 2024 16:13
Oran-Dan added a commit that referenced this pull request Aug 30, 2024
* ci: release version 0.6.8 (#346)

* fix: bindings

* feat: add default_trust_list.json

* test: add testing, not final

* feat: enable multiple trust lists

* chore: remove comment

* refactore: rename actions and reducers

* feat: add TrustList level actions

* refactor: trustlist owned bool, name to id, reset to default

* chore: fix domain name

* feat: add trust list management frontend

* refactor: implement lists view & domain list

* refactor: Wire up Tauri listeners in `onMount` of root layout (#322)

* Wire up Tauri state-changed listener in `onMount` of root layout

* Wire up Tauri error listener in root layout

* Update comments

* build: Replace `npm` with `pnpm` (#348)

* Swap out `npm` for `pnpm`
Fixes #347

* Address review comments

* chore: cargo fmt and fix binding naming

* feat: prevent edits on imported lists

* refactor: remove unused reset functionality

* feat: add placeholder when no lists

* refactor: trustlist actions

* refactor: remove trustlist default impl

* refactor: use updated Action names

* fix: rename broken bindings

* refactor: remove `Default` trait

* refactor: show `display_name` instead of `id`

* feat: update default trusted domains

---------

Co-authored-by: Daniel Mader <[email protected]>
Co-authored-by: Thilo Maier <[email protected]>
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.

Wrong route gets served
3 participants