From 704ebcde767ad5d061e3ae2142f72ef0f90110af Mon Sep 17 00:00:00 2001 From: FruitRiin Date: Sat, 16 Dec 2023 13:24:00 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E9=96=8B=E3=81=84=E3=81=A6=E3=82=8B?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=A7=E6=8A=95=E7=A8=BF=E5=85=88?= =?UTF-8?q?=E3=81=8C=E3=83=81=E3=83=A3=E3=83=B3=E3=83=8D=E3=83=AB=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=BB=E3=81=97=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/os.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index b02f6aa640..fdcf3eaf30 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -25,6 +25,7 @@ import MkContextMenu from '@/components/MkContextMenu.vue'; import { MenuItem } from '@/types/menu.js'; import copyToClipboard from '@/scripts/copy-to-clipboard.js'; import { showMovedDialog } from '@/scripts/show-moved-dialog.js'; +import {mainRouter} from "@/router.js"; export const openingWindowsCount = ref(0); @@ -601,6 +602,18 @@ export function post(props: Record = {}): Promise { // Vueが渡されたコンポーネントに内部的に__propsというプロパティを生やす影響で、 // 複数のpost formを開いたときに場合によってはエラーになる // もちろん複数のpost formを開けること自体Misskeyサイドのバグなのだが + + + const route = mainRouter.getCurrentPath().split("/") + if(route[1] === "channels") + props = { + ...props, + // 本当はチャンネル名や色もほしいけどどっからとってこよう + channel: { + id: route[2] + } + } + let dispose; popup(MkPostFormDialog, props, { closed: () => { From 88f07147da1ddc257a1e644514ba3ecb5b4e238d Mon Sep 17 00:00:00 2001 From: FruitRiin Date: Sat, 16 Dec 2023 19:36:58 +0900 Subject: [PATCH 2/3] fix lint --- packages/frontend/src/os.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index fdcf3eaf30..339a096be6 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -25,7 +25,7 @@ import MkContextMenu from '@/components/MkContextMenu.vue'; import { MenuItem } from '@/types/menu.js'; import copyToClipboard from '@/scripts/copy-to-clipboard.js'; import { showMovedDialog } from '@/scripts/show-moved-dialog.js'; -import {mainRouter} from "@/router.js"; +import { mainRouter } from '@/router.js'; export const openingWindowsCount = ref(0); @@ -603,16 +603,14 @@ export function post(props: Record = {}): Promise { // 複数のpost formを開いたときに場合によってはエラーになる // もちろん複数のpost formを開けること自体Misskeyサイドのバグなのだが - - const route = mainRouter.getCurrentPath().split("/") - if(route[1] === "channels") - props = { + const route = mainRouter.getCurrentPath().split('/'); + if (route[1] === 'channels') props = { ...props, // 本当はチャンネル名や色もほしいけどどっからとってこよう channel: { - id: route[2] - } - } + id: route[2], + }, + }; let dispose; popup(MkPostFormDialog, props, { From 6c821178ef1e10d3a513e90f2664bd860121ff95 Mon Sep 17 00:00:00 2001 From: mesi Date: Thu, 18 Jan 2024 06:55:12 +0000 Subject: [PATCH 3/3] =?UTF-8?q?router=E3=81=AE=E3=83=91=E3=82=B9=E3=82=92?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 1b78f962c7..5292dd3d25 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -24,7 +24,7 @@ import MkContextMenu from '@/components/MkContextMenu.vue'; import { MenuItem } from '@/types/menu.js'; import copyToClipboard from '@/scripts/copy-to-clipboard.js'; import { showMovedDialog } from '@/scripts/show-moved-dialog.js'; -import { mainRouter } from '@/router.js'; +import { mainRouter } from '@/global/router/main.js'; export const openingWindowsCount = ref(0);