diff --git a/src/constants/local-storage.keys.ts b/src/constants/local-storage.keys.ts index 240d02aadb..398bdf5d46 100644 --- a/src/constants/local-storage.keys.ts +++ b/src/constants/local-storage.keys.ts @@ -8,6 +8,7 @@ export default { EthereumTxType: 'app.ethereumTxType', SupportSignatures: 'app.supportSignatures', TermsAccepted: 'app.termsAccepted', + PoolSorting: 'app.poolSorting', }, Swap: { Gasless: 'swap.gasless', diff --git a/src/pages/index.vue b/src/pages/index.vue index e2fc31c01c..9f04920f2d 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -9,8 +9,17 @@ import usePoolFilters from '@/composables/pools/usePoolFilters'; import useBreakpoints from '@/composables/useBreakpoints'; import useNetwork from '@/composables/useNetwork'; import usePools from '@/composables/pools/usePools'; +import { lsGet, lsSet } from '@/lib/utils'; +import LS_KEYS from '@/constants/local-storage.keys'; -// COMPOSABLES +/** + * STATE + */ +const initSortCol = lsGet(LS_KEYS.App.PoolSorting) || 'totalLiquidity'; + +/** + * COMPOSABLES + */ const router = useRouter(); const { appNetworkConfig } = useNetwork(); const isElementSupported = appNetworkConfig.supportsElementPools; @@ -37,6 +46,7 @@ function navigateToCreatePool() { function onColumnSort(columnId: string) { poolsSortField.value = columnId; + lsSet(LS_KEYS.App.PoolSorting, columnId); } @@ -91,6 +101,7 @@ function onColumnSort(columnId: string) { :isLoading="isLoading" :selectedTokens="selectedTokens" class="mb-8" + :sortColumn="initSortCol" :hiddenColumns="['migrate', 'actions', 'lockEndDate']" :isLoadingMore="poolsIsFetchingNextPage" :isPaginated="isPaginated"