Fix: なんかおかしいの

This commit is contained in:
mattyatea 2023-10-21 11:32:09 +09:00
parent bbf1ba6a54
commit 2edbd4eca4
1 changed files with 3 additions and 15 deletions

View File

@ -276,7 +276,6 @@ function smallerVisibility(a: Visibility | string, b: Visibility | string): Visi
} }
function renote(viaKeyboard = false) { function renote(viaKeyboard = false) {
if (muted && !hideMutedNotes) return;
pleaseLogin(); pleaseLogin();
showMovedDialog(); showMovedDialog();
@ -289,7 +288,7 @@ function renote(viaKeyboard = false) {
action: () => { action: () => {
const el = renoteButton.value as HTMLElement | null | undefined; const el = renoteButton.value as HTMLElement | null | undefined;
if (el) { if (el) {
const rect = el?.getBoundingClientRect(); const rect = el.getBoundingClientRect();
const x = rect.left + (el.offsetWidth / 2); const x = rect.left + (el.offsetWidth / 2);
const y = rect.top + (el.offsetHeight / 2); const y = rect.top + (el.offsetHeight / 2);
os.popup(MkRippleEffect, {x, y}, {}, 'end'); os.popup(MkRippleEffect, {x, y}, {}, 'end');
@ -320,7 +319,7 @@ function renote(viaKeyboard = false) {
action: () => { action: () => {
const el = renoteButton.value as HTMLElement | null | undefined; const el = renoteButton.value as HTMLElement | null | undefined;
if (el) { if (el) {
const rect = el?.getBoundingClientRect(); const rect = el.getBoundingClientRect();
const x = rect.left + (el.offsetWidth / 2); const x = rect.left + (el.offsetWidth / 2);
const y = rect.top + (el.offsetHeight / 2); const y = rect.top + (el.offsetHeight / 2);
os.popup(MkRippleEffect, {x, y}, {}, 'end'); os.popup(MkRippleEffect, {x, y}, {}, 'end');
@ -359,7 +358,6 @@ function renote(viaKeyboard = false) {
} }
function reply(viaKeyboard = false): void { function reply(viaKeyboard = false): void {
if (muted && !hideMutedNotes) return;
pleaseLogin(); pleaseLogin();
os.post({ os.post({
reply: appearNote, reply: appearNote,
@ -371,7 +369,6 @@ function reply(viaKeyboard = false): void {
} }
function react(viaKeyboard = false): void { function react(viaKeyboard = false): void {
if (muted && !hideMutedNotes) return;
pleaseLogin(); pleaseLogin();
showMovedDialog(); showMovedDialog();
if (appearNote.reactionAcceptance === 'likeOnly') { if (appearNote.reactionAcceptance === 'likeOnly') {
@ -381,7 +378,7 @@ function react(viaKeyboard = false): void {
}); });
const el = reactButton.value as HTMLElement | null | undefined; const el = reactButton.value as HTMLElement | null | undefined;
if (el) { if (el) {
const rect = el?.getBoundingClientRect(); const rect = el.getBoundingClientRect();
const x = rect.left + (el.offsetWidth / 2); const x = rect.left + (el.offsetWidth / 2);
const y = rect.top + (el.offsetHeight / 2); const y = rect.top + (el.offsetHeight / 2);
os.popup(MkRippleEffect, {x, y}, {}, 'end'); os.popup(MkRippleEffect, {x, y}, {}, 'end');
@ -403,7 +400,6 @@ function react(viaKeyboard = false): void {
} }
function undoReact(note): void { function undoReact(note): void {
if (muted && !hideMutedNotes) return;
const oldReaction = note.myReaction; const oldReaction = note.myReaction;
if (!oldReaction) return; if (!oldReaction) return;
os.api('notes/reactions/delete', { os.api('notes/reactions/delete', {
@ -412,7 +408,6 @@ function undoReact(note): void {
} }
function onContextmenu(ev: MouseEvent): void { function onContextmenu(ev: MouseEvent): void {
if (muted && !hideMutedNotes) return;
const isLink = (el: HTMLElement) => { const isLink = (el: HTMLElement) => {
if (el.tagName === 'A') return true; if (el.tagName === 'A') return true;
// Audio // Audio
@ -441,7 +436,6 @@ function onContextmenu(ev: MouseEvent): void {
} }
function menu(viaKeyboard = false): void { function menu(viaKeyboard = false): void {
if (muted && !hideMutedNotes) return;
const {menu, cleanup} = getNoteMenu({ const {menu, cleanup} = getNoteMenu({
note: note, note: note,
translating, translating,
@ -456,7 +450,6 @@ function menu(viaKeyboard = false): void {
} }
async function clip() { async function clip() {
if (muted && !hideMutedNotes) return;
os.popupMenu(await getNoteClipMenu({ os.popupMenu(await getNoteClipMenu({
note: note, note: note,
isDeleted, isDeleted,
@ -465,7 +458,6 @@ async function clip() {
} }
function showRenoteMenu(viaKeyboard = false): void { function showRenoteMenu(viaKeyboard = false): void {
if (muted && !hideMutedNotes) return;
function getUnrenote(): MenuItem { function getUnrenote(): MenuItem {
return { return {
text: i18n.ts.unrenote, text: i18n.ts.unrenote,
@ -502,22 +494,18 @@ function showRenoteMenu(viaKeyboard = false): void {
} }
function focus() { function focus() {
if (muted && !hideMutedNotes) return;
el.value.focus(); el.value.focus();
} }
function blur() { function blur() {
if (muted && !hideMutedNotes) return;
el.value.blur(); el.value.blur();
} }
function focusBefore() { function focusBefore() {
if (muted && !hideMutedNotes) return;
focusPrev(el.value); focusPrev(el.value);
} }
function focusAfter() { function focusAfter() {
if (muted && !hideMutedNotes) return;
focusNext(el.value); focusNext(el.value);
} }