komikku/app
Fuad Hasan 14abec23bf
Hide sync library option when sync is disabled (jobobby04/TachiyomiSY#1275)
* Hide sync library option when sync is disabled

- Add isSyncEnabled parameter to LibraryToolbar and LibraryRegularToolbar
- Pass isSyncEnabled from LibraryTab to LibraryToolbar
- Conditionally display sync library action based on isSyncEnabled
- Update LibraryContent to include isSyncEnabled parameter
- Adjust LibraryTab to handle sync-related functionality
- Remove direct dependency on SyncPreferences in LibraryToolbar

* Update LibraryScreenModel to react to sync service changes

- Replace static isSyncEnabled update with dynamic observation
- Use syncPreferences.syncService().changes() to update isSyncEnabled state
- Ensure isSyncEnabled is updated whenever the sync service changes

Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>

* Fix sync service state update in LibraryScreenModel

- Resolve ambiguity in lambda parameters
- Correctly update isSyncEnabled state based on syncService value

* Optimize sync service state updates in LibraryScreenModel

- Add distinctUntilChanged() to filter out consecutive duplicate emissions
- Simplify mutableState.update lambda for better readability
- Remove redundant boolean comparison in isSyncEnabled assignment

---------

Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
(cherry picked from commit 697b0de22691eca7078a42f1abbc0636efd9f0e8)
2024-10-23 14:19:45 +07:00
..
src Hide sync library option when sync is disabled (jobobby04/TachiyomiSY#1275) 2024-10-23 14:19:45 +07:00
build.gradle.kts matching source with SY 2024-10-23 14:19:45 +07:00
proguard-android-optimize.txt Remove unused rxandroid dependency 2023-09-03 23:32:59 -04:00
proguard-rules.pro Fix crashlytics while using custom global exception handler (#338) 2024-09-05 15:29:28 +07:00