1
0

copy sharkey settings into new frontend preferences model

This commit is contained in:
Hazelnoot
2025-03-31 14:53:02 -04:00
parent 59ce4d6c28
commit c371af34e8
50 changed files with 468 additions and 425 deletions
+5 -5
View File
@@ -100,6 +100,7 @@ import { notesSearchAvailable } from '@/utility/check-permissions.js';
import { miLocalStorage } from '@/local-storage.js';
import { useRouter } from '@/router.js';
import { deepMerge } from '@/utility/merge.js';
import { store } from '@/store.js';
const router = useRouter();
@@ -122,12 +123,12 @@ const featuredPagination = computed(() => ({
},
}));
const withRenotes = computed<boolean>({
get: () => defaultStore.reactiveState.tl.value.filter.withRenotes,
get: () => store.r.tl.value.filter.withRenotes,
set: (x) => saveTlFilter('withRenotes', x),
});
const onlyFiles = computed<boolean>({
get: () => defaultStore.reactiveState.tl.value.filter.onlyFiles,
get: () => store.r.tl.value.filter.onlyFiles,
set: (x) => saveTlFilter('onlyFiles', x),
});
@@ -150,10 +151,9 @@ watch(() => props.channelId, async () => {
}
}, { immediate: true });
function saveTlFilter(key: keyof typeof defaultStore.state.tl.filter, newValue: boolean) {
function saveTlFilter(key: keyof typeof store.s.tl.filter, newValue: boolean) {
if (key !== 'withReplies' || $i) {
const out = deepMerge({ filter: { [key]: newValue } }, defaultStore.state.tl);
defaultStore.set('tl', out);
store.r.tl.value = deepMerge({ filter: { [key]: newValue } }, store.s.tl);
}
}