fix: documents selection state not reset on navigation.

This commit is contained in:
ItzNotABug
2024-07-19 14:42:11 +05:30
parent ecdedb72b6
commit cefd26c098
@@ -1,5 +1,5 @@
<script lang="ts">
import { goto, invalidate } from '$app/navigation';
import { afterNavigate, goto, invalidate } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
@@ -45,6 +45,10 @@
displayNames = preferences.getDisplayNames();
});
afterNavigate(() => {
selectedDb = []
});
function formatArray(array: unknown[]) {
if (array.length === 0) return '[ ]';