Switch newly added default Sources on once (#1)
The app now remembers which curated Sources it has seen. A Source that is on by default is enabled the first time it appears, also on installs with saved toggles; Sources seen before keep the user's choice. Installs from before this change count the current catalog as seen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f35ac9b806
commit
ea37a23c08
4 files changed
+135
-5
No files matched your search
@@ -74,6 +74,13 @@ class Storage {
|
||||
Future<void> saveEnabledSourceIds(Set<String> ids) =>
|
||||
_prefs.setStringList('enabled_sources', ids.toList());
|
||||
|
||||
/// Curated sources the app has already offered, so each one that is on by
|
||||
/// default switches on only once. Null means "never saved".
|
||||
Set<String>? loadSeenSourceIds() => _prefs.getStringList('seen_sources')?.toSet();
|
||||
|
||||
Future<void> saveSeenSourceIds(Set<String> ids) =>
|
||||
_prefs.setStringList('seen_sources', ids.toList());
|
||||
|
||||
List<NewsSource> loadCustomSources() {
|
||||
final raw = _prefs.getString('custom_sources');
|
||||
if (raw == null) return [];
|
||||
|
||||
Reference in new issue
Block a user