Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

フォロー中のユーザーに関する"TLに他の人への返信を含める"の設定が分かりづらい問題を修正 #198

Merged
merged 4 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Client
- Enhance: Unicode絵文字をslugから入力する際に`:ok:`のように最後の`:`を入力したあとにUnicode絵文字に変換できるように
- Fix: フォロー中のユーザーに関する"TLに他の人への返信を含める"の設定が分かりづらい問題を修正

## 2024.5.0 (merged to 2024.5.0-kinel.1)

Expand Down
31 changes: 17 additions & 14 deletions packages/frontend/src/pages/my-lists/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,25 @@ async function removeUser(item, ev) {
}

async function showMembershipMenu(item, ev) {
const withRepliesRef = ref(item.withReplies);
os.popupMenu([{
text: item.withReplies ? i18n.ts.hideRepliesToOthersInTimeline : i18n.ts.showRepliesToOthersInTimeline,
icon: item.withReplies ? 'ti ti-messages-off' : 'ti ti-messages',
action: async () => {
misskeyApi('users/lists/update-membership', {
listId: list.value.id,
userId: item.userId,
withReplies: !item.withReplies,
}).then(() => {
paginationEl.value.updateItem(item.id, (old) => ({
...old,
withReplies: !item.withReplies,
}));
});
},
type: 'switch',
text: i18n.ts.showRepliesToOthersInTimeline,
icon: 'ti ti-messages',
ref: withRepliesRef,
}], ev.currentTarget ?? ev.target);
watch(withRepliesRef, withReplies => {
misskeyApi('users/lists/update-membership', {
listId: list.value!.id,
userId: item.userId,
withReplies,
}).then(() => {
paginationEl.value!.updateItem(item.id, (old) => ({
...old,
withReplies,
}));
});
});
}

async function deleteList() {
Expand Down
28 changes: 15 additions & 13 deletions packages/frontend/src/scripts/get-user-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { $i, iAmModerator } from '@/account.js';
import { IRouter } from '@/nirax.js';
import { antennasCache, rolesCache, userListsCache } from '@/cache.js';
import { mainRouter } from '@/router/main.js';
import { MenuItem } from '@/types/menu.js';

export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter = mainRouter) {
const meId = $i ? $i.id : null;
Expand Down Expand Up @@ -81,15 +82,6 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter
});
}

async function toggleWithReplies() {
os.apiWithDialog('following/update', {
userId: user.id,
withReplies: !user.withReplies,
}).then(() => {
user.withReplies = !user.withReplies;
});
}

async function toggleNotify() {
os.apiWithDialog('following/update', {
userId: user.id,
Expand Down Expand Up @@ -152,7 +144,7 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter
});
}

let menu = [{
let menu: MenuItem[] = [{
icon: 'ti ti-at',
text: i18n.ts.copyUsername,
action: () => {
Expand Down Expand Up @@ -304,15 +296,25 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter

// フォローしたとしても user.isFollowing はリアルタイム更新されないので不便なため
//if (user.isFollowing) {
const withRepliesRef = ref(user.withReplies);
menu = menu.concat([{
icon: user.withReplies ? 'ti ti-messages-off' : 'ti ti-messages',
text: user.withReplies ? i18n.ts.hideRepliesToOthersInTimeline : i18n.ts.showRepliesToOthersInTimeline,
action: toggleWithReplies,
type: 'switch',
icon: 'ti ti-messages',
text: i18n.ts.showRepliesToOthersInTimeline,
ref: withRepliesRef,
}, {
icon: user.notify === 'none' ? 'ti ti-bell' : 'ti ti-bell-off',
text: user.notify === 'none' ? i18n.ts.notifyNotes : i18n.ts.unnotifyNotes,
action: toggleNotify,
}]);
watch(withRepliesRef, (withReplies) => {
misskeyApi('following/update', {
userId: user.id,
withReplies,
}).then(() => {
user.withReplies = withReplies;
});
});
//}

menu = menu.concat([{ type: 'divider' }, {
Expand Down
Loading