summaryrefslogtreecommitdiff
path: root/packages/frontend/src
diff options
context:
space:
mode:
authoranatawa12 <anatawa12@icloud.com>2023-12-04 14:38:21 +0900
committerGitHub <noreply@github.com>2023-12-04 14:38:21 +0900
commit18109fcef760dee8171364fd0382375c4047b8e7 (patch)
tree20bc2c25c8e90070ea8aa77c06cb3b7fa3a28810 /packages/frontend/src
parentfix dev build (#12566) (diff)
downloadmisskey-18109fcef760dee8171364fd0382375c4047b8e7.tar.gz
misskey-18109fcef760dee8171364fd0382375c4047b8e7.tar.bz2
misskey-18109fcef760dee8171364fd0382375c4047b8e7.zip
Filter User / Instance Mutes in FanoutTimelineEndpointService (#12565)
* fix: unnecessary logging in FanoutTimelineEndpointService * chore: TimelineOptions * chore: add FanoutTimelineName type * chore: forbid specifying both withReplies and withFiles since it's not implemented correctly * chore: filter mutes, replies, renotes, files in FanoutTimelineEndpointService * revert unintended changes * use isReply in NoteCreateService * fix: excludePureRenotes is not implemented * fix: replies to me is excluded from local timeline * chore(frontend): forbid enabling both withReplies and withFiles * docs(changelog): インスタンスミュートが効かない問題の修正について言及
Diffstat (limited to 'packages/frontend/src')
-rw-r--r--packages/frontend/src/components/MkMenu.vue2
-rw-r--r--packages/frontend/src/pages/timeline.vue4
-rw-r--r--packages/frontend/src/types/menu.ts2
-rw-r--r--packages/frontend/src/ui/deck/tl-column.vue2
4 files changed, 6 insertions, 4 deletions
diff --git a/packages/frontend/src/components/MkMenu.vue b/packages/frontend/src/components/MkMenu.vue
index 9457bf385f..4fafd35f72 100644
--- a/packages/frontend/src/components/MkMenu.vue
+++ b/packages/frontend/src/components/MkMenu.vue
@@ -202,7 +202,7 @@ function focusDown() {
}
function switchItem(item: MenuSwitch & { ref: any }) {
- if (item.disabled) return;
+ if (typeof item.disabled === 'boolean' ? item.disabled : item.disabled.value) return;
item.ref = !item.ref;
}
diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue
index cfe270aefb..b390d1931d 100644
--- a/packages/frontend/src/pages/timeline.vue
+++ b/packages/frontend/src/pages/timeline.vue
@@ -157,17 +157,17 @@ const headerActions = $computed(() => {
os.popupMenu([{
type: 'switch',
text: i18n.ts.showRenotes,
- icon: 'ti ti-repeat',
ref: $$(withRenotes),
}, src === 'local' || src === 'social' ? {
type: 'switch',
text: i18n.ts.showRepliesToOthersInTimeline,
ref: $$(withReplies),
+ disabled: $$(onlyFiles),
} : undefined, {
type: 'switch',
text: i18n.ts.fileAttachedOnly,
- icon: 'ti ti-photo',
ref: $$(onlyFiles),
+ disabled: src === 'local' || src === 'social' ? $$(withReplies) : false,
}], ev.currentTarget ?? ev.target);
},
},
diff --git a/packages/frontend/src/types/menu.ts b/packages/frontend/src/types/menu.ts
index 66061fcd70..fbe627176b 100644
--- a/packages/frontend/src/types/menu.ts
+++ b/packages/frontend/src/types/menu.ts
@@ -14,7 +14,7 @@ export type MenuLabel = { type: 'label', text: string };
export type MenuLink = { type: 'link', to: string, text: string, icon?: string, indicate?: boolean, avatar?: Misskey.entities.User };
export type MenuA = { type: 'a', href: string, target?: string, download?: string, text: string, icon?: string, indicate?: boolean };
export type MenuUser = { type: 'user', user: Misskey.entities.User, active?: boolean, indicate?: boolean, action: MenuAction };
-export type MenuSwitch = { type: 'switch', ref: Ref<boolean>, text: string, disabled?: boolean };
+export type MenuSwitch = { type: 'switch', ref: Ref<boolean>, text: string, disabled?: boolean | Ref<boolean> };
export type MenuButton = { type?: 'button', text: string, icon?: string, indicate?: boolean, danger?: boolean, active?: boolean, avatar?: Misskey.entities.User; action: MenuAction };
export type MenuParent = { type: 'parent', text: string, icon?: string, children: MenuItem[] | (() => Promise<MenuItem[]> | MenuItem[]) };
diff --git a/packages/frontend/src/ui/deck/tl-column.vue b/packages/frontend/src/ui/deck/tl-column.vue
index 9f24ea31ed..41582bbfe3 100644
--- a/packages/frontend/src/ui/deck/tl-column.vue
+++ b/packages/frontend/src/ui/deck/tl-column.vue
@@ -120,10 +120,12 @@ const menu = [{
type: 'switch',
text: i18n.ts.showRepliesToOthersInTimeline,
ref: $$(withReplies),
+ disabled: $$(onlyFiles),
} : undefined, {
type: 'switch',
text: i18n.ts.fileAttachedOnly,
ref: $$(onlyFiles),
+ disabled: props.column.tl === 'local' || props.column.tl === 'social' ? $$(withReplies) : false,
}];
</script>