Persist updated sort key to disk
This commit is contained in:
parent
29b016661a
commit
1578bf2529
|
@ -228,7 +228,8 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
|
|||
],
|
||||
),
|
||||
),
|
||||
onSelected: (int index) {
|
||||
onSelected: (int index) async {
|
||||
await LocalSettings.instance.setAlbumSortKey(sortKey);
|
||||
setState(() {
|
||||
sortKey = AlbumSortKey.values[index];
|
||||
});
|
||||
|
|
|
@ -22,7 +22,7 @@ class LocalSettings {
|
|||
AlbumSortKey.lastUpdated;
|
||||
}
|
||||
|
||||
void setAlbumSortKey(AlbumSortKey key) {
|
||||
_prefs.setInt(kCollectionSortPref, key.index);
|
||||
Future<bool> setAlbumSortKey(AlbumSortKey key) {
|
||||
return _prefs.setInt(kCollectionSortPref, key.index);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue