Skip to content

Commit

Permalink
fix(client): ノート詳細が開けないのを直したり
Browse files Browse the repository at this point in the history
Fix #8305
  • Loading branch information
syuilo committed Feb 11, 2022
1 parent de6e3d6 commit b01a032
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
You should also include the user name that made the change.
-->

## 12.x.x (unreleased)

### Improvements
-

### Bugfixes
- クライアント: ノートの詳細が表示されない問題を修正 @syuilo

## 12.106.2 (2022/02/11)

### Bugfixes
Expand Down
23 changes: 13 additions & 10 deletions packages/client/src/components/note-detailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,22 @@ const props = defineProps<{
const inChannel = inject('inChannel', null);
const note = $ref(JSON.parse(JSON.stringify(props.note)));
const isRenote = (
props.note.renote != null &&
props.note.text == null &&
props.note.fileIds.length === 0 &&
props.note.poll == null
note.renote != null &&
note.text == null &&
note.fileIds.length === 0 &&
note.poll == null
);
const el = ref<HTMLElement>();
const menuButton = ref<HTMLElement>();
const renoteButton = ref<InstanceType<typeof XRenoteButton>>();
const renoteTime = ref<HTMLElement>();
const reactButton = ref<HTMLElement>();
let appearNote = $ref(isRenote ? props.note.renote as misskey.entities.Note : props.note);
const isMyRenote = $i && ($i.id === props.note.userId);
let appearNote = $ref(isRenote ? note.renote as misskey.entities.Note : note);
const isMyRenote = $i && ($i.id === note.userId);
const showContent = ref(false);
const isDeleted = ref(false);
const muted = ref(checkWordMute(appearNote, $i, defaultStore.state.mutedWords));
Expand All @@ -188,8 +190,9 @@ const keymap = {
};
useNoteCapture({
appearNote: $$(appearNote),
rootEl: el,
note: $$(appearNote),
isDeletedRef: isDeleted,
});
function reply(viaKeyboard = false): void {
Expand Down Expand Up @@ -237,12 +240,12 @@ function onContextmenu(ev: MouseEvent): void {
ev.preventDefault();
react();
} else {
os.contextMenu(getNoteMenu({ note: props.note, translating, translation, menuButton }), ev).then(focus);
os.contextMenu(getNoteMenu({ note: note, translating, translation, menuButton }), ev).then(focus);
}
}
function menu(viaKeyboard = false): void {
os.popupMenu(getNoteMenu({ note: props.note, translating, translation, menuButton }), menuButton.value, {
os.popupMenu(getNoteMenu({ note: note, translating, translation, menuButton }), menuButton.value, {
viaKeyboard
}).then(focus);
}
Expand All @@ -255,7 +258,7 @@ function showRenoteMenu(viaKeyboard = false): void {
danger: true,
action: () => {
os.api('notes/delete', {
noteId: props.note.id
noteId: note.id
});
isDeleted.value = true;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const keymap = {
useNoteCapture({
rootEl: el,
note: $$(appearNote),
isDeletedRef: $$(isDeleted),
isDeletedRef: isDeleted,
});
function reply(viaKeyboard = false): void {
Expand Down

0 comments on commit b01a032

Please sign in to comment.