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

Provide notification handler in device and folder activities #2055

Conversation

adamszewe
Copy link
Contributor

wip, waiting for #2054
to merge first

Decouples a bit FolderActivity and DeviceActivity from SyncthingService by injecting NotificationHandler into them directly instead of relying on a method in SyncthingService to provide it for them.

@imsodin
Copy link
Member

imsodin commented Feb 10, 2024

How does this relate to #2054? Doesn't look like preferences are involved here.

With the previous way, only a single notification handler instance. Is it ok to have multiple?

@adamszewe
Copy link
Contributor Author

How does this relate to #2054? Doesn't look like preferences are involved here.

With the previous way, only a single notification handler instance. Is it ok to have multiple?

This PR is just waiting for the first one to get merged so I can rebase this one. I left it in draft as it's still pointing to the main branch even though it has changes on it from the first PR.

In this PR I want to refactor how the NotificationHandler is provided the FolderActivity and DeviceActivity.
Currently these classes are getting a reference to the NotificationHandler from SyncthingActivity, which couples them for no good reason.
We can just inject NotificationHandler into those classes.
NotificationHandler is already being provided as a s Singleton by Dagger, so there is going to be only a single instance of it in the app.

@adamszewe adamszewe closed this Mar 22, 2024
@adamszewe adamszewe deleted the provide-notification-handler-in-device-and-folder-activities branch March 22, 2024 19:29
@acolomb
Copy link
Member

acolomb commented Mar 22, 2024

Are you closing this just for lack of review / feedback? Or is there some different plan?

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