From 08ecf7ca79812cb904d2861ec82a67260a6819bf Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:19:14 +0900 Subject: refactor --- packages/frontend/src/pages/channel-editor.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/frontend/src/pages/channel-editor.vue') diff --git a/packages/frontend/src/pages/channel-editor.vue b/packages/frontend/src/pages/channel-editor.vue index ce26a26109..251f5d557d 100644 --- a/packages/frontend/src/pages/channel-editor.vue +++ b/packages/frontend/src/pages/channel-editor.vue @@ -138,9 +138,10 @@ async function addPinnedNote() { const { canceled, result: value } = await os.inputText({ title: i18n.ts.noteIdOrUrl, }); - if (canceled) return; + if (canceled || value == null) return; + const fromUrl = value.includes('/') ? value.split('/').pop() : null; const note = await os.apiWithDialog('notes/show', { - noteId: value.includes('/') ? value.split('/').pop() : value, + noteId: fromUrl ?? value, }); pinnedNotes.value = [{ id: note.id, -- cgit v1.2.3-freya