From fafe980315bdc6e4cdf956951adbf2f5d077dd71 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:16:50 +0900 Subject: [PATCH 01/17] =?UTF-8?q?fix:=20=E3=82=BB=E3=83=B3=E3=82=B7?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=83=96=E3=81=AA=E7=94=BB=E5=83=8F=E3=82=92?= =?UTF-8?q?=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3=E3=83=BB=E3=83=90=E3=83=8A?= =?UTF-8?q?=E3=83=BC=E3=81=AB=E6=8C=87=E5=AE=9A=E3=81=A7=E3=81=8D=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/src/server/api/endpoints/i/update.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index 84a1931a3d..2800720fba 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -74,6 +74,18 @@ export const meta = { id: '75aedb19-2afd-4e6d-87fc-67941256fa60', }, + avatarIsSensitive: { + message: 'The file specified as an avatar is marked as sensitive.', + code: 'AVATAR_IS_SENSITIVE', + id: '71bb5e53-4742-4609-b465-36081e131208', + }, + + bannerIsSensitive: { + message: 'The file specified as a banner is marked as sensitive.', + code: 'BANNER_IS_SENSITIVE', + id: 'e148b34c-9f33-4300-93e0-7817008fb366', + }, + noSuchPage: { message: 'No such page.', code: 'NO_SUCH_PAGE', @@ -326,6 +338,7 @@ export default class extends Endpoint { // eslint- if (avatar == null || avatar.userId !== user.id) throw new ApiError(meta.errors.noSuchAvatar); if (!avatar.type.startsWith('image/')) throw new ApiError(meta.errors.avatarNotAnImage); + if (avatar.isSensitive) throw new ApiError(meta.errors.avatarIsSensitive); updates.avatarId = avatar.id; updates.avatarUrl = this.driveFileEntityService.getPublicUrl(avatar, 'avatar'); @@ -341,6 +354,7 @@ export default class extends Endpoint { // eslint- if (banner == null || banner.userId !== user.id) throw new ApiError(meta.errors.noSuchBanner); if (!banner.type.startsWith('image/')) throw new ApiError(meta.errors.bannerNotAnImage); + if (banner.isSensitive) throw new ApiError(meta.errors.bannerIsSensitive); updates.bannerId = banner.id; updates.bannerUrl = this.driveFileEntityService.getPublicUrl(banner); From 16e92e6447559934c4129186c7a3ca7e60e2ed10 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:39:35 +0900 Subject: [PATCH 02/17] =?UTF-8?q?=E3=82=BB=E3=83=B3=E3=82=B7=E3=83=86?= =?UTF-8?q?=E3=82=A3=E3=83=96=E3=81=AA=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=82=92=E9=81=B8=E6=8A=9E=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 9 +++++ locales/ja-JP.yml | 2 ++ .../frontend/src/components/MkDrive.file.vue | 14 +++++++- packages/frontend/src/components/MkDrive.vue | 3 ++ .../src/components/MkDriveSelectDialog.vue | 3 +- packages/frontend/src/os.ts | 3 +- .../frontend/src/pages/settings/profile.vue | 4 +-- packages/frontend/src/scripts/select-file.ts | 33 +++++++++++++------ 8 files changed, 56 insertions(+), 15 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 01bec41d9e..690cf33b70 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -4936,6 +4936,15 @@ export interface Locale extends ILocale { * 動画・音声の再生にブラウザのUIを使用する */ "useNativeUIForVideoAudioPlayer": string; + /** + * センシティブなメディアは選択できません + */ + "cannotSelectSensitiveMedia": string; + /** + * 自分でセンシティブ設定を行っていないのにこのエラーが出ている場合、自動判定によりセンシティブなメディアとされている可能性があります。 + * サーバーの規則に照らして不要な場合は、ファイルのセンシティブ設定を解除してもう一度お試しください。 + */ + "cannotSelectSensitiveMediaDescription": string; "_bubbleGame": { /** * 遊び方 diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 4ba9ea0221..9bd813a856 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1230,6 +1230,8 @@ useTotp: "ワンタイムパスワードを使う" useBackupCode: "バックアップコードを使う" launchApp: "アプリを起動" useNativeUIForVideoAudioPlayer: "動画・音声の再生にブラウザのUIを使用する" +cannotSelectSensitiveMedia: "センシティブなメディアは選択できません" +cannotSelectSensitiveMediaDescription: "自分でセンシティブ設定を行っていないのにこのエラーが出ている場合、自動判定によりセンシティブなメディアとされている可能性があります。\nサーバーの規則に照らして不要な場合は、ファイルのセンシティブ設定を解除してもう一度お試しください。" _bubbleGame: howToPlay: "遊び方" diff --git a/packages/frontend/src/components/MkDrive.file.vue b/packages/frontend/src/components/MkDrive.file.vue index 4106b0a436..4380b4605e 100644 --- a/packages/frontend/src/components/MkDrive.file.vue +++ b/packages/frontend/src/components/MkDrive.file.vue @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only - + @@ -34,6 +34,7 @@ import { i18n } from '@/i18n.js'; withDefaults(defineProps<{ type?: 'file' | 'folder'; multiple: boolean; + excludeSensitive: boolean; }>(), { type: 'file', }); diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index c561e84a23..7c60d38543 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -541,11 +541,12 @@ export async function selectUser(opts: { includeSelf?: boolean; localOnly?: bool }); } -export async function selectDriveFile(multiple: boolean): Promise { +export async function selectDriveFile(multiple: boolean, excludeSensitive: boolean): Promise { return new Promise(resolve => { popup(defineAsyncComponent(() => import('@/components/MkDriveSelectDialog.vue')), { type: 'file', multiple, + excludeSensitive, }, { done: files => { if (files) { diff --git a/packages/frontend/src/pages/settings/profile.vue b/packages/frontend/src/pages/settings/profile.vue index 60bf9b4d3d..4b0363ef33 100644 --- a/packages/frontend/src/pages/settings/profile.vue +++ b/packages/frontend/src/pages/settings/profile.vue @@ -204,7 +204,7 @@ function save() { } function changeAvatar(ev) { - selectFile(ev.currentTarget ?? ev.target, i18n.ts.avatar).then(async (file) => { + selectFile(ev.currentTarget ?? ev.target, i18n.ts.avatar, true).then(async (file) => { let originalOrCropped = file; const { canceled } = await os.confirm({ @@ -231,7 +231,7 @@ function changeAvatar(ev) { } function changeBanner(ev) { - selectFile(ev.currentTarget ?? ev.target, i18n.ts.banner).then(async (file) => { + selectFile(ev.currentTarget ?? ev.target, i18n.ts.banner, true).then(async (file) => { let originalOrCropped = file; const { canceled } = await os.confirm({ diff --git a/packages/frontend/src/scripts/select-file.ts b/packages/frontend/src/scripts/select-file.ts index 9aa38178b2..c2fc3ef7a4 100644 --- a/packages/frontend/src/scripts/select-file.ts +++ b/packages/frontend/src/scripts/select-file.ts @@ -39,9 +39,9 @@ export function chooseFileFromPc(multiple: boolean, keepOriginal = false): Promi }); } -export function chooseFileFromDrive(multiple: boolean): Promise { +export function chooseFileFromDrive(multiple: boolean, excludeSensitive: boolean): Promise { return new Promise((res, rej) => { - os.selectDriveFile(multiple).then(files => { + os.selectDriveFile(multiple, excludeSensitive).then(files => { res(files); }); }); @@ -80,10 +80,23 @@ export function chooseFileFromUrl(): Promise { }); } -function select(src: any, label: string | null, multiple: boolean): Promise { +function select(src: any, label: string | null, multiple: boolean, excludeSensitive: boolean): Promise { return new Promise((res, rej) => { const keepOriginal = ref(defaultStore.state.keepOriginalUploading); + function _resolve(files: Misskey.entities.DriveFile[]) { + if (excludeSensitive && files.some(file => file.isSensitive)) { + os.alert({ + title: i18n.ts.cannotSelectSensitiveMedia, + text: i18n.ts.cannotSelectSensitiveMediaDescription, + }); + rej(); + return; + } + + res(files); + } + os.popupMenu([label ? { text: label, type: 'label', @@ -94,23 +107,23 @@ function select(src: any, label: string | null, multiple: boolean): Promise chooseFileFromPc(multiple, keepOriginal.value).then(files => res(files)), + action: () => chooseFileFromPc(multiple, keepOriginal.value).then(files => _resolve(files)), }, { text: i18n.ts.fromDrive, icon: 'ti ti-cloud', - action: () => chooseFileFromDrive(multiple).then(files => res(files)), + action: () => chooseFileFromDrive(multiple, excludeSensitive).then(files => _resolve(files)), }, { text: i18n.ts.fromUrl, icon: 'ti ti-link', - action: () => chooseFileFromUrl().then(file => res([file])), + action: () => chooseFileFromUrl().then(file => _resolve([file])), }], src); }); } -export function selectFile(src: any, label: string | null = null): Promise { - return select(src, label, false).then(files => files[0]); +export function selectFile(src: any, label: string | null = null, excludeSensitive = false): Promise { + return select(src, label, false, excludeSensitive).then(files => files[0]); } -export function selectFiles(src: any, label: string | null = null): Promise { - return select(src, label, true); +export function selectFiles(src: any, label: string | null = null, excludeSensitive = false): Promise { + return select(src, label, true, excludeSensitive); } From b13446f8d8bf1fac21ee5d0fafc5eccf9a4cce5d Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:52:15 +0900 Subject: [PATCH 03/17] tweak design --- packages/frontend/src/components/MkDrive.file.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/MkDrive.file.vue b/packages/frontend/src/components/MkDrive.file.vue index 4380b4605e..bb51cb6f0f 100644 --- a/packages/frontend/src/components/MkDrive.file.vue +++ b/packages/frontend/src/components/MkDrive.file.vue @@ -181,9 +181,20 @@ function onDragend() { } &.isDisabled { - opacity: 0.5; - pointer-events: none; cursor: not-allowed; + + .thumbnail { + opacity: 0.5; + } + + .name { + opacity: 0.5; + } + + &:hover, + &:active { + background: none; + } } } From aa2ab698b50c839d85aa59acb17bba2cda0fc6ca Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:58:57 +0900 Subject: [PATCH 04/17] fix --- packages/frontend/src/os.ts | 3 ++- packages/frontend/src/scripts/select-file.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 7c60d38543..fd0ca331f0 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -557,11 +557,12 @@ export async function selectDriveFile(multiple: boolean, excludeSensitive: boole }); } -export async function selectDriveFolder(multiple: boolean): Promise { +export async function selectDriveFolder(multiple: boolean, excludeSensitive: boolean): Promise { return new Promise(resolve => { popup(defineAsyncComponent(() => import('@/components/MkDriveSelectDialog.vue')), { type: 'folder', multiple, + excludeSensitive, }, { done: folders => { if (folders) { diff --git a/packages/frontend/src/scripts/select-file.ts b/packages/frontend/src/scripts/select-file.ts index c2fc3ef7a4..4f4d41456b 100644 --- a/packages/frontend/src/scripts/select-file.ts +++ b/packages/frontend/src/scripts/select-file.ts @@ -90,7 +90,7 @@ function select(src: any, label: string | null, multiple: boolean, excludeSensit title: i18n.ts.cannotSelectSensitiveMedia, text: i18n.ts.cannotSelectSensitiveMediaDescription, }); - rej(); + rej(new Error('Sensitive media is selected')); return; } From 3c3decc0ffd988443fa7956ab8d57cf4296c53b6 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 8 Apr 2024 19:01:08 +0900 Subject: [PATCH 05/17] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41cbdea023..6d172915eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Enhance: URLプレビューの有効化・無効化を設定できるように #13569 - Enhance: アンテナでBotによるノートを除外できるように (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/545) +- Fix: センシティブな画像をアイコン・バナーに指定できないように - Fix: Play作成時に設定した公開範囲が機能していない問題を修正 ### Client From 7c45dc1cdd5b1ad68adbb9a55b7291b0bf0c4edf Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 8 Apr 2024 19:13:46 +0900 Subject: [PATCH 06/17] =?UTF-8?q?enhance(frontend):=20=E3=82=A2=E3=82=A4?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E7=94=BB=E5=83=8F=E3=83=BB=E3=83=90=E3=83=8A?= =?UTF-8?q?=E3=83=BC=E7=94=BB=E5=83=8F=E3=82=92=E5=A4=96=E3=81=9B=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../frontend/src/pages/settings/profile.vue | 36 +++++++++++++++++-- packages/frontend/src/scripts/select-file.ts | 13 +++---- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d172915eb..ef31ea8e87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ - Enhance: ノートについているリアクションの「もっと!」から、リアクションの一覧を表示できるように - Enhance: リプライにて引用がある場合テキストが空でもノートできるように - 引用したいノートのURLをコピーしリプライ投稿画面にペーストして添付することで達成できます +- Enhance: アイコン画像・バナー画像を外せるように - Fix: 一部のページ内リンクが正しく動作しない問題を修正 - Fix: 周年の実績が閏年を考慮しない問題を修正 - Fix: ローカルURLのプレビューポップアップが左上に表示される diff --git a/packages/frontend/src/pages/settings/profile.vue b/packages/frontend/src/pages/settings/profile.vue index 4b0363ef33..03d31f870b 100644 --- a/packages/frontend/src/pages/settings/profile.vue +++ b/packages/frontend/src/pages/settings/profile.vue @@ -204,7 +204,23 @@ function save() { } function changeAvatar(ev) { - selectFile(ev.currentTarget ?? ev.target, i18n.ts.avatar, true).then(async (file) => { + selectFile(ev.currentTarget ?? ev.target, i18n.ts.avatar, true, $i.avatarId ? [ + { type: 'divider' }, + { + type: 'button', + text: i18n.ts.detach, + icon: 'ti ti-circle-x', + action: () => { + os.apiWithDialog('i/update', { + avatarId: null, + }).then(() => { + $i.avatarId = null; + $i.avatarUrl = null; + globalEvents.emit('requestClearPageCache'); + }); + }, + }, + ] : undefined).then(async (file) => { let originalOrCropped = file; const { canceled } = await os.confirm({ @@ -231,7 +247,23 @@ function changeAvatar(ev) { } function changeBanner(ev) { - selectFile(ev.currentTarget ?? ev.target, i18n.ts.banner, true).then(async (file) => { + selectFile(ev.currentTarget ?? ev.target, i18n.ts.banner, true, $i.bannerId ? [ + { type: 'divider' }, + { + type: 'button', + text: i18n.ts.detach, + icon: 'ti ti-circle-x', + action: () => { + os.apiWithDialog('i/update', { + bannerId: null, + }).then(() => { + $i.bannerId = null; + $i.bannerUrl = null; + globalEvents.emit('requestClearPageCache'); + }); + }, + }, + ] : undefined).then(async (file) => { let originalOrCropped = file; const { canceled } = await os.confirm({ diff --git a/packages/frontend/src/scripts/select-file.ts b/packages/frontend/src/scripts/select-file.ts index 4f4d41456b..7df7efe5b4 100644 --- a/packages/frontend/src/scripts/select-file.ts +++ b/packages/frontend/src/scripts/select-file.ts @@ -5,6 +5,7 @@ import { ref } from 'vue'; import * as Misskey from 'misskey-js'; +import type { MenuItem } from '@/types/menu.js'; import * as os from '@/os.js'; import { misskeyApi } from '@/scripts/misskey-api.js'; import { useStream } from '@/stream.js'; @@ -80,7 +81,7 @@ export function chooseFileFromUrl(): Promise { }); } -function select(src: any, label: string | null, multiple: boolean, excludeSensitive: boolean): Promise { +function select(src: any, label: string | null, multiple: boolean, excludeSensitive: boolean, additionalMenu: MenuItem[] = []): Promise { return new Promise((res, rej) => { const keepOriginal = ref(defaultStore.state.keepOriginalUploading); @@ -116,14 +117,14 @@ function select(src: any, label: string | null, multiple: boolean, excludeSensit text: i18n.ts.fromUrl, icon: 'ti ti-link', action: () => chooseFileFromUrl().then(file => _resolve([file])), - }], src); + }, ...additionalMenu], src); }); } -export function selectFile(src: any, label: string | null = null, excludeSensitive = false): Promise { - return select(src, label, false, excludeSensitive).then(files => files[0]); +export function selectFile(src: any, label: string | null = null, excludeSensitive = false, additionalMenu?: MenuItem[]): Promise { + return select(src, label, false, excludeSensitive, additionalMenu).then(files => files[0]); } -export function selectFiles(src: any, label: string | null = null, excludeSensitive = false): Promise { - return select(src, label, true, excludeSensitive); +export function selectFiles(src: any, label: string | null = null, excludeSensitive = false, additionalMenu?: MenuItem[]): Promise { + return select(src, label, true, excludeSensitive, additionalMenu); } From ec79544efdb85dc7c8af00670f90f30a896bef66 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:18:32 +0900 Subject: [PATCH 07/17] use option --- .../frontend/src/pages/settings/profile.vue | 70 ++++++++++--------- packages/frontend/src/scripts/select-file.ts | 10 +-- 2 files changed, 43 insertions(+), 37 deletions(-) diff --git a/packages/frontend/src/pages/settings/profile.vue b/packages/frontend/src/pages/settings/profile.vue index 03d31f870b..172fb454a4 100644 --- a/packages/frontend/src/pages/settings/profile.vue +++ b/packages/frontend/src/pages/settings/profile.vue @@ -204,23 +204,26 @@ function save() { } function changeAvatar(ev) { - selectFile(ev.currentTarget ?? ev.target, i18n.ts.avatar, true, $i.avatarId ? [ - { type: 'divider' }, - { - type: 'button', - text: i18n.ts.detach, - icon: 'ti ti-circle-x', - action: () => { - os.apiWithDialog('i/update', { - avatarId: null, - }).then(() => { - $i.avatarId = null; - $i.avatarUrl = null; - globalEvents.emit('requestClearPageCache'); - }); + selectFile(ev.currentTarget ?? ev.target, i18n.ts.avatar, { + excludeSensitive: true, + additionalMenu: $i.avatarId ? [ + { type: 'divider' }, + { + type: 'button', + text: i18n.ts.detach, + icon: 'ti ti-circle-x', + action: () => { + os.apiWithDialog('i/update', { + avatarId: null, + }).then(() => { + $i.avatarId = null; + $i.avatarUrl = null; + globalEvents.emit('requestClearPageCache'); + }); + }, }, - }, - ] : undefined).then(async (file) => { + ] : undefined, + }).then(async (file) => { let originalOrCropped = file; const { canceled } = await os.confirm({ @@ -247,23 +250,26 @@ function changeAvatar(ev) { } function changeBanner(ev) { - selectFile(ev.currentTarget ?? ev.target, i18n.ts.banner, true, $i.bannerId ? [ - { type: 'divider' }, - { - type: 'button', - text: i18n.ts.detach, - icon: 'ti ti-circle-x', - action: () => { - os.apiWithDialog('i/update', { - bannerId: null, - }).then(() => { - $i.bannerId = null; - $i.bannerUrl = null; - globalEvents.emit('requestClearPageCache'); - }); + selectFile(ev.currentTarget ?? ev.target, i18n.ts.banner, { + excludeSensitive: true, + additionalMenu: $i.bannerId ? [ + { type: 'divider' }, + { + type: 'button', + text: i18n.ts.detach, + icon: 'ti ti-circle-x', + action: () => { + os.apiWithDialog('i/update', { + bannerId: null, + }).then(() => { + $i.bannerId = null; + $i.bannerUrl = null; + globalEvents.emit('requestClearPageCache'); + }); + }, }, - }, - ] : undefined).then(async (file) => { + ] : undefined, + }).then(async (file) => { let originalOrCropped = file; const { canceled } = await os.confirm({ diff --git a/packages/frontend/src/scripts/select-file.ts b/packages/frontend/src/scripts/select-file.ts index 7df7efe5b4..daa3f760ac 100644 --- a/packages/frontend/src/scripts/select-file.ts +++ b/packages/frontend/src/scripts/select-file.ts @@ -81,7 +81,7 @@ export function chooseFileFromUrl(): Promise { }); } -function select(src: any, label: string | null, multiple: boolean, excludeSensitive: boolean, additionalMenu: MenuItem[] = []): Promise { +function select(src: any, label: string | null, multiple: boolean, excludeSensitive = false, additionalMenu: MenuItem[] = []): Promise { return new Promise((res, rej) => { const keepOriginal = ref(defaultStore.state.keepOriginalUploading); @@ -121,10 +121,10 @@ function select(src: any, label: string | null, multiple: boolean, excludeSensit }); } -export function selectFile(src: any, label: string | null = null, excludeSensitive = false, additionalMenu?: MenuItem[]): Promise { - return select(src, label, false, excludeSensitive, additionalMenu).then(files => files[0]); +export function selectFile(src: any, label: string | null = null, options?: { excludeSensitive?: boolean; additionalMenu?: MenuItem[]; }): Promise { + return select(src, label, false, options?.excludeSensitive, options?.additionalMenu).then(files => files[0]); } -export function selectFiles(src: any, label: string | null = null, excludeSensitive = false, additionalMenu?: MenuItem[]): Promise { - return select(src, label, true, excludeSensitive, additionalMenu); +export function selectFiles(src: any, label: string | null = null, options?: { excludeSensitive?: boolean; additionalMenu?: MenuItem[]; }): Promise { + return select(src, label, true, options?.excludeSensitive, options?.additionalMenu); } From 466835a614930e172d9621d2e14e58f0d6733c5d Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:21:56 +0900 Subject: [PATCH 08/17] use options --- packages/frontend/src/scripts/select-file.ts | 27 +++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/packages/frontend/src/scripts/select-file.ts b/packages/frontend/src/scripts/select-file.ts index daa3f760ac..c1e9a5230f 100644 --- a/packages/frontend/src/scripts/select-file.ts +++ b/packages/frontend/src/scripts/select-file.ts @@ -13,6 +13,12 @@ import { i18n } from '@/i18n.js'; import { defaultStore } from '@/store.js'; import { uploadFile } from '@/scripts/upload.js'; +type SelectFileOptions = { + multiple?: boolean; + excludeSensitive?: boolean; + additionalMenu?: MenuItem[]; +}; + export function chooseFileFromPc(multiple: boolean, keepOriginal = false): Promise { return new Promise((res, rej) => { const input = document.createElement('input'); @@ -81,12 +87,19 @@ export function chooseFileFromUrl(): Promise { }); } -function select(src: any, label: string | null, multiple: boolean, excludeSensitive = false, additionalMenu: MenuItem[] = []): Promise { +function select(src: any, label: string | null, options?: SelectFileOptions): Promise { + const _options = { + multiple: false, + excludeSensitive: false, + additionalMenu: [], + ...options, + }; + return new Promise((res, rej) => { const keepOriginal = ref(defaultStore.state.keepOriginalUploading); function _resolve(files: Misskey.entities.DriveFile[]) { - if (excludeSensitive && files.some(file => file.isSensitive)) { + if (_options.excludeSensitive && files.some(file => file.isSensitive)) { os.alert({ title: i18n.ts.cannotSelectSensitiveMedia, text: i18n.ts.cannotSelectSensitiveMediaDescription, @@ -108,23 +121,23 @@ function select(src: any, label: string | null, multiple: boolean, excludeSensit }, { text: i18n.ts.upload, icon: 'ti ti-upload', - action: () => chooseFileFromPc(multiple, keepOriginal.value).then(files => _resolve(files)), + action: () => chooseFileFromPc(_options.multiple, keepOriginal.value).then(files => _resolve(files)), }, { text: i18n.ts.fromDrive, icon: 'ti ti-cloud', - action: () => chooseFileFromDrive(multiple, excludeSensitive).then(files => _resolve(files)), + action: () => chooseFileFromDrive(_options.multiple, _options.excludeSensitive).then(files => _resolve(files)), }, { text: i18n.ts.fromUrl, icon: 'ti ti-link', action: () => chooseFileFromUrl().then(file => _resolve([file])), - }, ...additionalMenu], src); + }, ..._options.additionalMenu], src); }); } export function selectFile(src: any, label: string | null = null, options?: { excludeSensitive?: boolean; additionalMenu?: MenuItem[]; }): Promise { - return select(src, label, false, options?.excludeSensitive, options?.additionalMenu).then(files => files[0]); + return select(src, label, { ...options, multiple: false }).then(files => files[0]); } export function selectFiles(src: any, label: string | null = null, options?: { excludeSensitive?: boolean; additionalMenu?: MenuItem[]; }): Promise { - return select(src, label, true, options?.excludeSensitive, options?.additionalMenu); + return select(src, label, { ...options, multiple: true }); } From db27623f2d672bbf9f3b070321e9233534ef5ad4 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Tue, 9 Apr 2024 14:35:51 +0900 Subject: [PATCH 09/17] =?UTF-8?q?=E3=81=84=E3=82=8D=E3=81=84=E3=82=8D?= =?UTF-8?q?=E5=A4=89=E3=81=88=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/os.ts | 106 ++++++++++-------- .../frontend/src/pages/settings/profile.vue | 47 ++++++-- packages/frontend/src/scripts/select-file.ts | 36 +++--- 3 files changed, 110 insertions(+), 79 deletions(-) diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index fd0ca331f0..bb10cd7895 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -27,66 +27,78 @@ import { showMovedDialog } from '@/scripts/show-moved-dialog.js'; export const openingWindowsCount = ref(0); +export async function apiErrorAlert(err: Misskey.api.APIError, endpoint?: string) { + let title: string | undefined; + let text = err.message + '\n' + err.id; + if (err.code === 'INTERNAL_ERROR') { + title = i18n.ts.internalServerError; + text = i18n.ts.internalServerErrorDescription; + const date = new Date().toISOString(); + const { result } = await actions({ + type: 'error', + title, + text, + actions: [{ + value: 'ok', + text: i18n.ts.gotIt, + primary: true, + }, { + value: 'copy', + text: i18n.ts.copyErrorInfo, + }], + }); + if (result === 'copy') { + const errorReportText = [ + `Info: ${JSON.stringify(err.info)}`, + `Date: ${date}`, + ]; + if (endpoint) errorReportText.unshift(`Endpoint: ${endpoint}`); + + copyToClipboard(errorReportText.join('\n')); + success(); + } + return; + } else if (err.code === 'RATE_LIMIT_EXCEEDED') { + title = i18n.ts.cannotPerformTemporary; + text = i18n.ts.cannotPerformTemporaryDescription; + } else if (err.code === 'INVALID_PARAM') { + title = i18n.ts.invalidParamError; + text = i18n.ts.invalidParamErrorDescription; + } else if (err.code === 'ROLE_PERMISSION_DENIED') { + title = i18n.ts.permissionDeniedError; + text = i18n.ts.permissionDeniedErrorDescription; + } else if (err.code.startsWith('TOO_MANY')) { + title = i18n.ts.youCannotCreateAnymore; + text = `${i18n.ts.error}: ${err.id}`; + } else if (err.message.startsWith('Unexpected token')) { + title = i18n.ts.gotInvalidResponseError; + text = i18n.ts.gotInvalidResponseErrorDescription; + } + alert({ + type: 'error', + title, + text, + }); +} + export const apiWithDialog = (( endpoint: E, data: P = {} as any, token?: string | null | undefined, ) => { const promise = misskeyApi(endpoint, data, token); - promiseDialog(promise, null, async (err) => { - let title: string | undefined; - let text = err.message + '\n' + err.id; - if (err.code === 'INTERNAL_ERROR') { - title = i18n.ts.internalServerError; - text = i18n.ts.internalServerErrorDescription; - const date = new Date().toISOString(); - const { result } = await actions({ - type: 'error', - title, - text, - actions: [{ - value: 'ok', - text: i18n.ts.gotIt, - primary: true, - }, { - value: 'copy', - text: i18n.ts.copyErrorInfo, - }], - }); - if (result === 'copy') { - copyToClipboard(`Endpoint: ${endpoint}\nInfo: ${JSON.stringify(err.info)}\nDate: ${date}`); - success(); - } - return; - } else if (err.code === 'RATE_LIMIT_EXCEEDED') { - title = i18n.ts.cannotPerformTemporary; - text = i18n.ts.cannotPerformTemporaryDescription; - } else if (err.code === 'INVALID_PARAM') { - title = i18n.ts.invalidParamError; - text = i18n.ts.invalidParamErrorDescription; - } else if (err.code === 'ROLE_PERMISSION_DENIED') { - title = i18n.ts.permissionDeniedError; - text = i18n.ts.permissionDeniedErrorDescription; - } else if (err.code.startsWith('TOO_MANY')) { - title = i18n.ts.youCannotCreateAnymore; - text = `${i18n.ts.error}: ${err.id}`; - } else if (err.message.startsWith('Unexpected token')) { - title = i18n.ts.gotInvalidResponseError; - text = i18n.ts.gotInvalidResponseErrorDescription; - } - alert({ - type: 'error', - title, - text, - }); + promiseDialog(promise, null, (err) => { + apiErrorAlert(err); }); return promise; }) as typeof misskeyApi; +type Unpromise = T extends Promise ? U : never; + export function promiseDialog>( promise: T, - onSuccess?: ((res: any) => void) | null, + onSuccess?: ((res: Unpromise) => void) | null, onFailure?: ((err: Misskey.api.APIError) => void) | null, text?: string, ): T { diff --git a/packages/frontend/src/pages/settings/profile.vue b/packages/frontend/src/pages/settings/profile.vue index 172fb454a4..398cb7fd58 100644 --- a/packages/frontend/src/pages/settings/profile.vue +++ b/packages/frontend/src/pages/settings/profile.vue @@ -128,6 +128,7 @@ import { defaultStore } from '@/store.js'; import { globalEvents } from '@/events.js'; import MkInfo from '@/components/MkInfo.vue'; import MkTextarea from '@/components/MkTextarea.vue'; +import { misskeyApi } from '@/scripts/misskey-api.js'; const $i = signinRequired(); @@ -239,13 +240,27 @@ function changeAvatar(ev) { }); } - const i = await os.apiWithDialog('i/update', { + const updatePromise = misskeyApi('i/update', { avatarId: originalOrCropped.id, }); - $i.avatarId = i.avatarId; - $i.avatarUrl = i.avatarUrl; - globalEvents.emit('requestClearPageCache'); - claimAchievement('profileFilled'); + + os.promiseDialog(updatePromise, (updatedUser) => { + os.success(); + $i.avatarId = updatedUser.avatarId; + $i.avatarUrl = updatedUser.avatarUrl; + globalEvents.emit('requestClearPageCache'); + claimAchievement('profileFilled'); + }, (err) => { + if (err.code === 'AVATAR_IS_SENSITIVE') { + os.alert({ + type: 'error', + title: i18n.ts.cannotSelectSensitiveMedia, + text: i18n.ts.cannotSelectSensitiveMediaDescription, + }); + } else { + os.apiErrorAlert(err, 'i/update'); + } + }); }); } @@ -285,12 +300,26 @@ function changeBanner(ev) { }); } - const i = await os.apiWithDialog('i/update', { + const updatePromise = misskeyApi('i/update', { bannerId: originalOrCropped.id, }); - $i.bannerId = i.bannerId; - $i.bannerUrl = i.bannerUrl; - globalEvents.emit('requestClearPageCache'); + + os.promiseDialog(updatePromise, (updatedUser) => { + os.success(); + $i.bannerId = updatedUser.bannerId; + $i.bannerUrl = updatedUser.bannerUrl; + globalEvents.emit('requestClearPageCache'); + }, (err) => { + if (err.code === 'BANNER_IS_SENSITIVE') { + os.alert({ + type: 'error', + title: i18n.ts.cannotSelectSensitiveMedia, + text: i18n.ts.cannotSelectSensitiveMediaDescription, + }); + } else { + os.apiErrorAlert(err, 'i/update'); + } + }); }); } diff --git a/packages/frontend/src/scripts/select-file.ts b/packages/frontend/src/scripts/select-file.ts index c1e9a5230f..308a42d9c4 100644 --- a/packages/frontend/src/scripts/select-file.ts +++ b/packages/frontend/src/scripts/select-file.ts @@ -12,6 +12,7 @@ import { useStream } from '@/stream.js'; import { i18n } from '@/i18n.js'; import { defaultStore } from '@/store.js'; import { uploadFile } from '@/scripts/upload.js'; +import { deepMerge } from '@/scripts/merge.js'; type SelectFileOptions = { multiple?: boolean; @@ -88,29 +89,18 @@ export function chooseFileFromUrl(): Promise { } function select(src: any, label: string | null, options?: SelectFileOptions): Promise { - const _options = { + const _options = deepMerge(options ?? {}, { multiple: false, + + /** ドライブファイル選択時のみに適用 */ excludeSensitive: false, - additionalMenu: [], - ...options, - }; + + additionalMenu: [] as MenuItem[], + }); return new Promise((res, rej) => { const keepOriginal = ref(defaultStore.state.keepOriginalUploading); - function _resolve(files: Misskey.entities.DriveFile[]) { - if (_options.excludeSensitive && files.some(file => file.isSensitive)) { - os.alert({ - title: i18n.ts.cannotSelectSensitiveMedia, - text: i18n.ts.cannotSelectSensitiveMediaDescription, - }); - rej(new Error('Sensitive media is selected')); - return; - } - - res(files); - } - os.popupMenu([label ? { text: label, type: 'label', @@ -121,23 +111,23 @@ function select(src: any, label: string | null, options?: SelectFileOptions): Pr }, { text: i18n.ts.upload, icon: 'ti ti-upload', - action: () => chooseFileFromPc(_options.multiple, keepOriginal.value).then(files => _resolve(files)), + action: () => chooseFileFromPc(_options.multiple, keepOriginal.value).then(files => res(files)), }, { text: i18n.ts.fromDrive, icon: 'ti ti-cloud', - action: () => chooseFileFromDrive(_options.multiple, _options.excludeSensitive).then(files => _resolve(files)), + action: () => chooseFileFromDrive(_options.multiple, _options.excludeSensitive).then(files => res(files)), }, { text: i18n.ts.fromUrl, icon: 'ti ti-link', - action: () => chooseFileFromUrl().then(file => _resolve([file])), - }, ..._options.additionalMenu], src); + action: () => chooseFileFromUrl().then(file => res([file])), + }, ...(_options.additionalMenu)], src); }); } export function selectFile(src: any, label: string | null = null, options?: { excludeSensitive?: boolean; additionalMenu?: MenuItem[]; }): Promise { - return select(src, label, { ...options, multiple: false }).then(files => files[0]); + return select(src, label, { ...(options ? options : {}), multiple: false }).then(files => files[0]); } export function selectFiles(src: any, label: string | null = null, options?: { excludeSensitive?: boolean; additionalMenu?: MenuItem[]; }): Promise { - return select(src, label, { ...options, multiple: true }); + return select(src, label, { ...(options ? options : {}), multiple: true }); } From 54a41d3c9d254ec48fbfd3c55a466ac090a6d929 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sun, 14 Apr 2024 11:53:53 +0900 Subject: [PATCH 10/17] refactor --- packages/frontend/src/os.ts | 109 +++++++++--------- .../frontend/src/pages/settings/profile.vue | 52 +++------ 2 files changed, 70 insertions(+), 91 deletions(-) diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index bb10cd7895..c4c545be1b 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -27,72 +27,67 @@ import { showMovedDialog } from '@/scripts/show-moved-dialog.js'; export const openingWindowsCount = ref(0); -export async function apiErrorAlert(err: Misskey.api.APIError, endpoint?: string) { - let title: string | undefined; - let text = err.message + '\n' + err.id; - if (err.code === 'INTERNAL_ERROR') { - title = i18n.ts.internalServerError; - text = i18n.ts.internalServerErrorDescription; - const date = new Date().toISOString(); - const { result } = await actions({ - type: 'error', - title, - text, - actions: [{ - value: 'ok', - text: i18n.ts.gotIt, - primary: true, - }, { - value: 'copy', - text: i18n.ts.copyErrorInfo, - }], - }); - if (result === 'copy') { - const errorReportText = [ - `Info: ${JSON.stringify(err.info)}`, - `Date: ${date}`, - ]; - if (endpoint) errorReportText.unshift(`Endpoint: ${endpoint}`); - - copyToClipboard(errorReportText.join('\n')); - success(); - } - return; - } else if (err.code === 'RATE_LIMIT_EXCEEDED') { - title = i18n.ts.cannotPerformTemporary; - text = i18n.ts.cannotPerformTemporaryDescription; - } else if (err.code === 'INVALID_PARAM') { - title = i18n.ts.invalidParamError; - text = i18n.ts.invalidParamErrorDescription; - } else if (err.code === 'ROLE_PERMISSION_DENIED') { - title = i18n.ts.permissionDeniedError; - text = i18n.ts.permissionDeniedErrorDescription; - } else if (err.code.startsWith('TOO_MANY')) { - title = i18n.ts.youCannotCreateAnymore; - text = `${i18n.ts.error}: ${err.id}`; - } else if (err.message.startsWith('Unexpected token')) { - title = i18n.ts.gotInvalidResponseError; - text = i18n.ts.gotInvalidResponseErrorDescription; - } - alert({ - type: 'error', - title, - text, - }); -} - export const apiWithDialog = (( endpoint: E, data: P = {} as any, token?: string | null | undefined, + customErrors?: Record, ) => { const promise = misskeyApi(endpoint, data, token); - promiseDialog(promise, null, (err) => { - apiErrorAlert(err); + promiseDialog(promise, null, async (err) => { + let title: string | undefined; + let text = err.message + '\n' + err.id; + if (err.code === 'INTERNAL_ERROR') { + title = i18n.ts.internalServerError; + text = i18n.ts.internalServerErrorDescription; + const date = new Date().toISOString(); + const { result } = await actions({ + type: 'error', + title, + text, + actions: [{ + value: 'ok', + text: i18n.ts.gotIt, + primary: true, + }, { + value: 'copy', + text: i18n.ts.copyErrorInfo, + }], + }); + if (result === 'copy') { + copyToClipboard(`Endpoint: ${endpoint}\nInfo: ${JSON.stringify(err.info)}\nDate: ${date}`); + success(); + } + return; + } else if (err.code === 'RATE_LIMIT_EXCEEDED') { + title = i18n.ts.cannotPerformTemporary; + text = i18n.ts.cannotPerformTemporaryDescription; + } else if (err.code === 'INVALID_PARAM') { + title = i18n.ts.invalidParamError; + text = i18n.ts.invalidParamErrorDescription; + } else if (err.code === 'ROLE_PERMISSION_DENIED') { + title = i18n.ts.permissionDeniedError; + text = i18n.ts.permissionDeniedErrorDescription; + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + } else if (customErrors && customErrors[err.code] != null) { + title = customErrors[err.code].title; + text = customErrors[err.code].text; + } else if (err.code.startsWith('TOO_MANY')) { + title = i18n.ts.youCannotCreateAnymore; + text = `${i18n.ts.error}: ${err.id}`; + } else if (err.message.startsWith('Unexpected token')) { + title = i18n.ts.gotInvalidResponseError; + text = i18n.ts.gotInvalidResponseErrorDescription; + } + alert({ + type: 'error', + title, + text, + }); }); return promise; -}) as typeof misskeyApi; +}); type Unpromise = T extends Promise ? U : never; diff --git a/packages/frontend/src/pages/settings/profile.vue b/packages/frontend/src/pages/settings/profile.vue index 398cb7fd58..5ca8d0949d 100644 --- a/packages/frontend/src/pages/settings/profile.vue +++ b/packages/frontend/src/pages/settings/profile.vue @@ -240,26 +240,18 @@ function changeAvatar(ev) { }); } - const updatePromise = misskeyApi('i/update', { + await os.apiWithDialog('i/update', { avatarId: originalOrCropped.id, - }); - - os.promiseDialog(updatePromise, (updatedUser) => { - os.success(); - $i.avatarId = updatedUser.avatarId; - $i.avatarUrl = updatedUser.avatarUrl; + }, undefined, { + 'AVATAR_IS_SENSITIVE': { + title: i18n.ts.cannotSelectSensitiveMedia, + text: i18n.ts.cannotSelectSensitiveMediaDescription, + }, + }).then(() => { + $i.avatarId = originalOrCropped.id; + $i.avatarUrl = originalOrCropped.url; globalEvents.emit('requestClearPageCache'); claimAchievement('profileFilled'); - }, (err) => { - if (err.code === 'AVATAR_IS_SENSITIVE') { - os.alert({ - type: 'error', - title: i18n.ts.cannotSelectSensitiveMedia, - text: i18n.ts.cannotSelectSensitiveMediaDescription, - }); - } else { - os.apiErrorAlert(err, 'i/update'); - } }); }); } @@ -300,25 +292,17 @@ function changeBanner(ev) { }); } - const updatePromise = misskeyApi('i/update', { + await os.apiWithDialog('i/update', { bannerId: originalOrCropped.id, - }); - - os.promiseDialog(updatePromise, (updatedUser) => { - os.success(); - $i.bannerId = updatedUser.bannerId; - $i.bannerUrl = updatedUser.bannerUrl; + }, undefined, { + 'BANNER_IS_SENSITIVE': { + title: i18n.ts.cannotSelectSensitiveMedia, + text: i18n.ts.cannotSelectSensitiveMediaDescription, + }, + }).then(() => { + $i.bannerId = originalOrCropped.id; + $i.bannerUrl = originalOrCropped.url; globalEvents.emit('requestClearPageCache'); - }, (err) => { - if (err.code === 'BANNER_IS_SENSITIVE') { - os.alert({ - type: 'error', - title: i18n.ts.cannotSelectSensitiveMedia, - text: i18n.ts.cannotSelectSensitiveMediaDescription, - }); - } else { - os.apiErrorAlert(err, 'i/update'); - } }); }); } From b6704a84ff4b0e2f692e1d1a0764f0f8e0d046d3 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: Mon, 3 Jun 2024 22:01:04 +0900 Subject: [PATCH 11/17] Update packages/frontend/src/os.ts Co-authored-by: anatawa12 --- packages/frontend/src/os.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 359b334396..5e7a8a128e 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -93,7 +93,7 @@ type Unpromise = T extends Promise ? U : never; export function promiseDialog>( promise: T, - onSuccess?: ((res: Unpromise) => void) | null, + onSuccess?: ((res: Awaited) => void) | null, onFailure?: ((err: Misskey.api.APIError) => void) | null, text?: string, ): T { From 9a27e429dde1e8859c9e09f9e9a4906c33ef2a7e 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: Mon, 3 Jun 2024 22:01:39 +0900 Subject: [PATCH 12/17] Update os.ts --- packages/frontend/src/os.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 5e7a8a128e..1950a3eb5b 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -89,8 +89,6 @@ export const apiWithDialog = ( = T extends Promise ? U : never; - export function promiseDialog>( promise: T, onSuccess?: ((res: Awaited) => void) | null, From e2c9043179f11cc1b7a7051a10c9d99a918a1229 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: Tue, 5 Nov 2024 15:16:46 +0900 Subject: [PATCH 13/17] Update os.ts --- packages/frontend/src/os.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index e95aa90254..5e05e73884 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -73,10 +73,6 @@ export const apiWithDialog = ( Date: Tue, 5 Nov 2024 15:17:38 +0900 Subject: [PATCH 14/17] Update profile.vue --- packages/frontend/src/pages/settings/profile.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/pages/settings/profile.vue b/packages/frontend/src/pages/settings/profile.vue index 1b9b6b7df4..c2e6c7959c 100644 --- a/packages/frontend/src/pages/settings/profile.vue +++ b/packages/frontend/src/pages/settings/profile.vue @@ -262,7 +262,7 @@ function changeAvatar(ev) { await os.apiWithDialog('i/update', { avatarId: originalOrCropped.id, }, undefined, { - 'AVATAR_IS_SENSITIVE': { + '71bb5e53-4742-4609-b465-36081e131208': { title: i18n.ts.cannotSelectSensitiveMedia, text: i18n.ts.cannotSelectSensitiveMediaDescription, }, @@ -314,7 +314,7 @@ function changeBanner(ev) { await os.apiWithDialog('i/update', { bannerId: originalOrCropped.id, }, undefined, { - 'BANNER_IS_SENSITIVE': { + 'e148b34c-9f33-4300-93e0-7817008fb366': { title: i18n.ts.cannotSelectSensitiveMedia, text: i18n.ts.cannotSelectSensitiveMediaDescription, }, From 2016c8aa81e1c013546b357b5f6abdc74b3cfd4d 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: Tue, 5 Nov 2024 15:18:19 +0900 Subject: [PATCH 15/17] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b52b44bf2..2b8e37ef77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -254,6 +254,9 @@ - Fix: deck uiでタイムラインを切り替えた際にTLの設定項目が更新されず、`TLに他の人への返信を含める`のトグルが表示されない問題を修正 - Fix: ウィジェットのタイムライン選択欄に無効化されたタイムラインが表示される問題を修正 - Fix: サウンドにドライブの音声を使用している際にドライブの音声が再生できなくなると設定が変更できなくなる問題を修正 +- Fix: デフォルトテーマに無効なテーマコードを入力するとUIが使用できなくなる問題を修正 +- 翻訳の更新 +- 依存関係の更新 ### Server - Feat: レートリミット制限に引っかかったときに`Retry-After`ヘッダーを返すように (#13949) From a631446b42c39887522232c7cb090cd0372bd36c 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: Tue, 5 Nov 2024 15:18:45 +0900 Subject: [PATCH 16/17] Update CHANGELOG.md --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b8e37ef77..c5c9be8e09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -200,6 +200,9 @@ - Enhance: 管理画面でアーカイブにしたお知らせを表示・編集できるように - Fix: 配信停止したインスタンス一覧が見れなくなる問題を修正 - Fix: Dockerコンテナの立ち上げ時に`pnpm`のインストールで固まることがある問題 +- Fix: デフォルトテーマに無効なテーマコードを入力するとUIが使用できなくなる問題を修正 +- 翻訳の更新 +- 依存関係の更新 ### Client - Feat: ユーザーページから「このユーザーのノートを検索」できるように (#14128) @@ -254,9 +257,6 @@ - Fix: deck uiでタイムラインを切り替えた際にTLの設定項目が更新されず、`TLに他の人への返信を含める`のトグルが表示されない問題を修正 - Fix: ウィジェットのタイムライン選択欄に無効化されたタイムラインが表示される問題を修正 - Fix: サウンドにドライブの音声を使用している際にドライブの音声が再生できなくなると設定が変更できなくなる問題を修正 -- Fix: デフォルトテーマに無効なテーマコードを入力するとUIが使用できなくなる問題を修正 -- 翻訳の更新 -- 依存関係の更新 ### Server - Feat: レートリミット制限に引っかかったときに`Retry-After`ヘッダーを返すように (#13949) From aee1c34cf35b1477b2cffa7a7accc638b2286e8d 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: Tue, 5 Nov 2024 15:19:11 +0900 Subject: [PATCH 17/17] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5c9be8e09..7d8595174e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -200,8 +200,8 @@ - Enhance: 管理画面でアーカイブにしたお知らせを表示・編集できるように - Fix: 配信停止したインスタンス一覧が見れなくなる問題を修正 - Fix: Dockerコンテナの立ち上げ時に`pnpm`のインストールで固まることがある問題 -- Fix: デフォルトテーマに無効なテーマコードを入力するとUIが使用できなくなる問題を修正 -- 翻訳の更新 +- Fix: デフォルトテーマに無効なテーマコードを入力するとUIが使用できなくなる問題を修正 +- 翻訳の更新 - 依存関係の更新 ### Client