diff options
| author | dakkar <dakkar@thenautilus.net> | 2024-05-23 21:56:28 +0000 |
|---|---|---|
| committer | Amelia Yukii <amelia.yukii@shourai.de> | 2024-05-23 21:56:28 +0000 |
| commit | d27ce442eab9ae8e2f4ddff1e8ca0d0412e73046 (patch) | |
| tree | 4eccd67e2159ca02de8b67730bfabf40ee11e0c0 /packages/frontend/src/ui/deck | |
| parent | merge: update list of project members (!452) (diff) | |
| download | sharkey-d27ce442eab9ae8e2f4ddff1e8ca0d0412e73046.tar.gz sharkey-d27ce442eab9ae8e2f4ddff1e8ca0d0412e73046.tar.bz2 sharkey-d27ce442eab9ae8e2f4ddff1e8ca0d0412e73046.zip | |
more timeline filters - #228
Diffstat (limited to 'packages/frontend/src/ui/deck')
| -rw-r--r-- | packages/frontend/src/ui/deck/channel-column.vue | 26 | ||||
| -rw-r--r-- | packages/frontend/src/ui/deck/list-column.vue | 14 |
2 files changed, 37 insertions, 3 deletions
diff --git a/packages/frontend/src/ui/deck/channel-column.vue b/packages/frontend/src/ui/deck/channel-column.vue index 984de82c3f..993be46910 100644 --- a/packages/frontend/src/ui/deck/channel-column.vue +++ b/packages/frontend/src/ui/deck/channel-column.vue @@ -13,13 +13,13 @@ SPDX-License-Identifier: AGPL-3.0-only <div style="padding: 8px; text-align: center;"> <MkButton primary gradate rounded inline small @click="post"><i class="ph-pencil-simple ph-bold ph-lg"></i></MkButton> </div> - <MkTimeline ref="timeline" src="channel" :channel="column.channelId"/> + <MkTimeline ref="timeline" src="channel" :channel="column.channelId" :key="column.channelId + column.withRenotes + column.onlyFiles" :withRenotes="withRenotes" :onlyFiles="onlyFiles"/> </template> </XColumn> </template> <script lang="ts" setup> -import { shallowRef } from 'vue'; +import { watch, ref, shallowRef } from 'vue'; import * as Misskey from 'misskey-js'; import XColumn from './column.vue'; import { updateColumn, Column } from './deck-store.js'; @@ -36,6 +36,20 @@ const props = defineProps<{ const timeline = shallowRef<InstanceType<typeof MkTimeline>>(); const channel = shallowRef<Misskey.entities.Channel>(); +const withRenotes = ref(props.column.withRenotes ?? true); +const onlyFiles = ref(props.column.onlyFiles ?? false); + +watch(withRenotes, v => { + updateColumn(props.column.id, { + withRenotes: v, + }); +}); + +watch(onlyFiles, v => { + updateColumn(props.column.id, { + onlyFiles: v, + }); +}); if (props.column.channelId == null) { setChannel(); @@ -75,5 +89,13 @@ const menu = [{ icon: 'ph-pencil-simple ph-bold ph-lg', text: i18n.ts.selectChannel, action: setChannel, +}, { + type: 'switch', + text: i18n.ts.showRenotes, + ref: withRenotes, +}, { + type: 'switch', + text: i18n.ts.fileAttachedOnly, + ref: onlyFiles, }]; </script> diff --git a/packages/frontend/src/ui/deck/list-column.vue b/packages/frontend/src/ui/deck/list-column.vue index 128562823b..f7988ed1b7 100644 --- a/packages/frontend/src/ui/deck/list-column.vue +++ b/packages/frontend/src/ui/deck/list-column.vue @@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only <i class="ph-list ph-bold ph-lg"></i><span style="margin-left: 8px;">{{ column.name }}</span> </template> - <MkTimeline v-if="column.listId" ref="timeline" src="list" :list="column.listId" :withRenotes="withRenotes"/> + <MkTimeline v-if="column.listId" ref="timeline" src="list" :list="column.listId" :key="column.listId + column.withRenotes + column.onlyFiles" :withRenotes="withRenotes" :onlyFiles="onlyFiles"/> </XColumn> </template> @@ -29,6 +29,7 @@ const props = defineProps<{ const timeline = shallowRef<InstanceType<typeof MkTimeline>>(); const withRenotes = ref(props.column.withRenotes ?? true); +const onlyFiles = ref(props.column.onlyFiles ?? false); if (props.column.listId == null) { setList(); @@ -40,6 +41,12 @@ watch(withRenotes, v => { }); }); +watch(onlyFiles, v => { + updateColumn(props.column.id, { + onlyFiles: v, + }); +}); + async function setList() { const lists = await misskeyApi('users/lists/list'); const { canceled, result: list } = await os.select({ @@ -75,5 +82,10 @@ const menu = [ text: i18n.ts.showRenotes, ref: withRenotes, }, + { + type: 'switch', + text: i18n.ts.fileAttachedOnly, + ref: onlyFiles, + }, ]; </script> |