Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit ea72a25

Browse files
committed
feat: toggle to show crosssync notes only
1 parent f617f3b commit ea72a25

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/common/store.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type { Profiles } from 'unidata.js';
77

88
export interface Settings {
99
syncing: boolean | string;
10+
notesShowCSSCOnly: boolean;
1011
address?: string;
1112
handle?: string;
1213
}
@@ -17,6 +18,7 @@ export const getSettings = async (): Promise<Settings> =>
1718
Object.assign(
1819
{
1920
syncing: true,
21+
notesShowCSSCOnly: true,
2022
},
2123
await bucket.get(),
2224
);
@@ -58,6 +60,7 @@ export const store = createStore<State>({
5860
state.characters = undefined;
5961
state.settings = {
6062
syncing: true,
63+
notesShowCSSCOnly: true,
6164
};
6265
await bucket.clear();
6366
},

src/pages/HomeRoot.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ const load = async () => {
6262
identity: store.state.settings.handle!,
6363
platform: 'Crossbell',
6464
source: 'Crossbell Note',
65+
...(store.state.settings.notesShowCSSCOnly && {
66+
filter: {
67+
applications: ['CrossSync'],
68+
},
69+
}),
6570
cursor,
6671
});
6772
notes.value = notes.value.concat(result?.list || []);

src/pages/Settings.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727
</div>
2828
</div>
2929
</el-card>
30+
<el-card shadow="hover" class="cursor-pointer">
31+
<div class="flex flex-row" style="justify-content: space-between">
32+
<div class="flex">Show CrossSync notes only</div>
33+
<div class="flex">
34+
<el-switch class="switch h-6" v-model="isNotesCSSCOnly" @change="setNotesCSSCOnly" />
35+
</div>
36+
</div>
37+
</el-card>
3038
</el-col>
3139
</div>
3240
</div>
@@ -42,6 +50,7 @@ const router = useRouter();
4250
const store = useStore();
4351
4452
const isSyncing = ref(store.state.settings.syncing && !!store.state.settings.handle);
53+
const isNotesCSSCOnly = ref(store.state.settings.notesShowCSSCOnly);
4554
4655
if (store.state.settings.address) {
4756
if (!store.state.characters?.list.length) {
@@ -68,8 +77,15 @@ const setSyncing = async () => {
6877
});
6978
};
7079
80+
const setNotesCSSCOnly = async () => {
81+
await store.dispatch('setSettings', {
82+
notesShowCSSCOnly: isNotesCSSCOnly.value,
83+
});
84+
};
85+
7186
watchEffect(() => {
7287
isSyncing.value = store.state.settings.syncing && !!store.state.settings.handle;
88+
isNotesCSSCOnly.value = store.state.settings.notesShowCSSCOnly;
7389
});
7490
</script>
7591

0 commit comments

Comments
 (0)