diff --git a/src/components/contextual/pages/vebal/LMVoting/GaugesFilters.vue b/src/components/contextual/pages/vebal/LMVoting/GaugesFilters.vue index 39dd24e146..8240f0aded 100644 --- a/src/components/contextual/pages/vebal/LMVoting/GaugesFilters.vue +++ b/src/components/contextual/pages/vebal/LMVoting/GaugesFilters.vue @@ -32,7 +32,7 @@ const networkFiltersArr = ref([...props.activeNetworkFilters]); * otherwise activeFiltersNum would change only after 500ms debounce which lead to poor UX */ const isExpiredFilterActive = ref(false); -const activeNetworksArr = ref([]); +const activeNetworksArr = ref(props.activeNetworkFilters); /** * COMPUTED diff --git a/src/components/contextual/pages/vebal/LMVoting/LMVoting.vue b/src/components/contextual/pages/vebal/LMVoting/LMVoting.vue index 89f3a8e58e..ad5842532d 100644 --- a/src/components/contextual/pages/vebal/LMVoting/LMVoting.vue +++ b/src/components/contextual/pages/vebal/LMVoting/LMVoting.vue @@ -16,12 +16,21 @@ import { bpsToPercentage, isGaugeExpired } from '../voting-utils'; import useNumbers from '@/composables/useNumbers'; import { isVotingCompleted, useVoting } from '../providers/voting.provider'; +/** + * COMPOSABLES + */ +const router = useRouter(); + /** * DATA */ + const tokenFilter = useDebouncedRef('', 500); const showExpiredGauges = useDebouncedRef(false, 500); -const activeNetworkFilters = useDebouncedRef([], 500); +const activeNetworkFilters = useDebouncedRef( + getDefaultActiveNetworkFilter(), + 500 +); const networkFilters: Network[] = Object.entries(configs) .filter(details => { @@ -51,7 +60,6 @@ const { isWalletReady } = useWeb3(); const { hasVeBalBalance, noVeBalBalance } = useVeBal(); const { fNum } = useNumbers(); - const { isLoading, isLoadingVotingPools, @@ -143,6 +151,21 @@ function addIntersectionObserver(): void { observer = new IntersectionObserver(callback, options); observer.observe(intersectionSentinel.value); } + +function getDefaultActiveNetworkFilter() { + const param = router.currentRoute.value.query.chain; + if (!param || typeof param !== 'string') { + return []; + } + + const networkToFilter = Network[param.toUpperCase()]; + if (!networkToFilter) { + return []; + } + + return [networkToFilter]; +} + onMounted(() => { addIntersectionObserver(); });