enhance(frontend): タイムラインでファイルが添付されたノートのみ表示するオプションを追加

This commit is contained in:
syuilo
2023-09-29 16:56:17 +09:00
parent d92e2b6ae0
commit e5c339b86a
7 changed files with 31 additions and 2 deletions

View File

@@ -32,6 +32,7 @@ export type Column = {
tl?: 'home' | 'local' | 'social' | 'global';
withRenotes?: boolean;
withReplies?: boolean;
onlyFiles?: boolean;
};
export const deckStore = markRaw(new Storage('deck', {

View File

@@ -23,10 +23,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkTimeline
v-else-if="column.tl"
ref="timeline"
:key="column.tl + withRenotes + withReplies"
:key="column.tl + withRenotes + withReplies + onlyFiles"
:src="column.tl"
:withRenotes="withRenotes"
:withReplies="withReplies"
:onlyFiles="onlyFiles"
/>
</XColumn>
</template>
@@ -52,6 +53,7 @@ const isLocalTimelineAvailable = (($i == null && instance.policies.ltlAvailable)
const isGlobalTimelineAvailable = (($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable));
const withRenotes = $ref(props.column.withRenotes ?? true);
const withReplies = $ref(props.column.withReplies ?? false);
const onlyFiles = $ref(props.column.onlyFiles ?? false);
watch($$(withRenotes), v => {
updateColumn(props.column.id, {
@@ -111,6 +113,10 @@ const menu = [{
type: 'switch',
text: i18n.ts.withReplies,
ref: $$(withReplies),
}, {
type: 'switch',
text: i18n.ts.fileAttachedOnly,
ref: $$(onlyFiles),
}];
</script>