1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-10 00:05:24 +02:00

fix(notifications): sort by newest first by default [EE-4467] (#7891)

This commit is contained in:
itsconquest 2022-10-19 15:25:20 +13:00 committed by GitHub
parent 58947fee69
commit c1f94be9b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View file

@ -18,7 +18,7 @@ import { columns } from './columns';
import { createStore } from './datatable-store';
const storageKey = 'notifications-list';
const useSettingsStore = createStore(storageKey, 'time');
const useSettingsStore = createStore(storageKey, 'time', true);
export function NotificationsView() {
const settingsStore = useSettingsStore();

View file

@ -19,11 +19,15 @@ interface TableSettings
SettableColumnsTableSettings,
RefreshableTableSettings {}
export function createStore(storageKey: string, initialSortBy?: string) {
export function createStore(
storageKey: string,
initialSortBy?: string,
desc?: boolean
) {
return create<TableSettings>()(
persist(
(set) => ({
...sortableSettings(set, initialSortBy),
...sortableSettings(set, initialSortBy, desc),
...paginationSettings(set),
...hiddenColumnsSettings(set),
...refreshableSettings(set),