From 6942a920c8c5bc51b358341bb9b451addcc4ec2b Mon Sep 17 00:00:00 2001 From: woxtu Date: Thu, 18 Jul 2024 00:31:52 +0900 Subject: [PATCH 1/5] refactor(frontend): Improve typing (#14240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Improve typing * Remove redundant promise * Refactor * Update packages/frontend/src/scripts/mfm-function-picker.ts Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> * Update packages/frontend/src/scripts/mfm-function-picker.ts Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> --------- Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> --- .../src/scripts/mfm-function-picker.ts | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/packages/frontend/src/scripts/mfm-function-picker.ts b/packages/frontend/src/scripts/mfm-function-picker.ts index 8867a8c50ff6..9938e534c139 100644 --- a/packages/frontend/src/scripts/mfm-function-picker.ts +++ b/packages/frontend/src/scripts/mfm-function-picker.ts @@ -7,29 +7,24 @@ import { Ref, nextTick } from 'vue'; import * as os from '@/os.js'; import { i18n } from '@/i18n.js'; import { MFM_TAGS } from '@/const.js'; +import type { MenuItem } from '@/types/menu.js'; /** * MFMの装飾のリストを表示する */ -export function mfmFunctionPicker(src: any, textArea: HTMLInputElement | HTMLTextAreaElement, textRef: Ref) { - return new Promise((res, rej) => { - os.popupMenu([{ - text: i18n.ts.addMfmFunction, - type: 'label', - }, ...getFunctionList(textArea, textRef)], src); - }); +export function mfmFunctionPicker(src: HTMLElement | EventTarget | null, textArea: HTMLInputElement | HTMLTextAreaElement, textRef: Ref) { + os.popupMenu([{ + text: i18n.ts.addMfmFunction, + type: 'label', + }, ...getFunctionList(textArea, textRef)], src); } -function getFunctionList(textArea: HTMLInputElement | HTMLTextAreaElement, textRef: Ref) : object[] { - const ret: object[] = []; - MFM_TAGS.forEach(tag => { - ret.push({ - text: tag, - icon: 'ti ti-icons', - action: () => add(textArea, textRef, tag), - }); - }); - return ret; +function getFunctionList(textArea: HTMLInputElement | HTMLTextAreaElement, textRef: Ref): MenuItem[] { + return MFM_TAGS.map(tag => ({ + text: tag, + icon: 'ti ti-icons', + action: () => add(textArea, textRef, tag), + })); } function add(textArea: HTMLInputElement | HTMLTextAreaElement, textRef: Ref, type: string) { From 3331f3972a02f8b662a3bf3e5a94f7b0a45ebbb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 18 Jul 2024 01:22:24 +0900 Subject: [PATCH 2/5] =?UTF-8?q?fix(frontend):=20=E3=80=8C=E3=82=A2?= =?UTF-8?q?=E3=83=8B=E3=83=A1=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E7=94=BB?= =?UTF-8?q?=E5=83=8F=E3=82=92=E5=86=8D=E7=94=9F=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=80=8D=E3=81=8C=E3=82=AA=E3=83=B3=E3=81=AE=E3=81=A8=E3=81=8D?= =?UTF-8?q?=E3=81=AB=E3=83=90=E3=83=8A=E3=83=BC=E7=94=BB=E5=83=8F=E3=83=BB?= =?UTF-8?q?=E3=82=B5=E3=83=BC=E3=83=90=E3=83=BC=E8=83=8C=E6=99=AF=E7=94=BB?= =?UTF-8?q?=E5=83=8F=E3=81=8C=E3=82=A2=E3=83=8B=E3=83=A1=E3=83=BC=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=20(#14243)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: stop animating banner and backgrounds when stop showing animated images is enabled (cherry picked from commit 8fe2596316e9688509745706ea424f0b4bfd4136) * chore: nest ternary (cherry picked from commit 2783fe5f5bd7c0647db9f9b6fb5e000e4f411092) * chore: flip ternary (cherry picked from commit b9d66f824cff373cc53bfa846a56c16f456a6d5b) * update changelog --------- Co-authored-by: Marie --- CHANGELOG.md | 2 ++ packages/frontend/src/components/MkUserInfo.vue | 4 +++- packages/frontend/src/components/MkUserPopup.vue | 3 ++- packages/frontend/src/pages/user/home.vue | 11 +++++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02497883f0ab..9eea70d3b09d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ - Fix: ショートカットキーが連打できる問題を修正 (Cherry-picked from https://github.com/taiyme/misskey/pull/234) - Fix: MkSignin.vueのcredentialRequestからReactivityを削除(ProxyがPasskey認証処理に渡ることを避けるため) +- Fix: 「アニメーション画像を再生しない」がオンのときでもサーバーのバナー画像・背景画像がアニメーションしてしまう問題を修正 + (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/574) ### Server - Feat: レートリミット制限に引っかかったときに`Retry-After`ヘッダーを返すように (#13949) diff --git a/packages/frontend/src/components/MkUserInfo.vue b/packages/frontend/src/components/MkUserInfo.vue index d6f1ae453c3e..f0b9606590f1 100644 --- a/packages/frontend/src/components/MkUserInfo.vue +++ b/packages/frontend/src/components/MkUserInfo.vue @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only