summaryrefslogtreecommitdiff
path: root/packages/frontend/src/pages/channel-editor.vue
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/pages/channel-editor.vue')
-rw-r--r--packages/frontend/src/pages/channel-editor.vue5
1 files changed, 3 insertions, 2 deletions
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,