refactor: generic SliceContains

This commit is contained in:
Drew Weymouth
2023-04-29 10:21:40 -07:00
parent 329b290d61
commit 31e82ae367
3 changed files with 7 additions and 16 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ func NewAlbumsPage(cfg *backend.AlbumsPageConfig, contr *controller.Controller,
SizeName: theme.SizeNameHeadingText,
}
a.sortOrder = NewSelect(backend.AlbumSortOrders, a.onSortOrderChanged)
if !sharedutil.StringSliceContains(backend.AlbumSortOrders, cfg.SortOrder) {
if !sharedutil.SliceContains(backend.AlbumSortOrders, cfg.SortOrder) {
cfg.SortOrder = string(backend.AlbumSortRecentlyAdded)
}
a.sortOrder.Selected = cfg.SortOrder