From 284b87dae85a356dd543a03f81d12031b11f7554 Mon Sep 17 00:00:00 2001
From: Freya Murphy <freya@freyacat.org>
Date: Mon, 2 Mar 2026 16:05:12 -0500
Subject: split url into webUrl and localUrl (like mastodon)

---
 packages/frontend/src/components/MkPostForm.vue | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'packages/frontend/src/components/MkPostForm.vue')

diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue
index a650365a28..ca4855a084 100644
--- a/packages/frontend/src/components/MkPostForm.vue
+++ b/packages/frontend/src/components/MkPostForm.vue
@@ -111,7 +111,7 @@ import * as mfm from 'mfm-js';
 import * as Misskey from 'misskey-js';
 import insertTextAtCursor from 'insert-text-at-cursor';
 import { toASCII } from 'punycode.js';
-import { host, url } from '@@/js/config.js';
+import { webUrl } from '@@/js/config.js';
 import { appendContentWarning } from '@@/js/append-content-warning.js';
 import type { ShallowRef } from 'vue';
 import type { MenuItem } from '@/types/menu.js';
@@ -715,7 +715,7 @@ async function onPaste(ev: ClipboardEvent) {
 
 	const paste = ev.clipboardData.getData('text');
 
-	if (!renoteTargetNote.value && !quoteId.value && paste.startsWith(url + '/notes/') && !$i.rejectQuotes) {
+	if (!renoteTargetNote.value && !quoteId.value && paste.startsWith(webUrl + '/notes/') && !$i.rejectQuotes) {
 		ev.preventDefault();
 
 		os.confirm({
@@ -727,7 +727,7 @@ async function onPaste(ev: ClipboardEvent) {
 				return;
 			}
 
-			quoteId.value = paste.substring(url.length).match(/^\/notes\/(.+?)\/?$/)?.[1] ?? null;
+			quoteId.value = paste.substring(webUrl.length).match(/^\/notes\/(.+?)\/?$/)?.[1] ?? null;
 		});
 	}
 
@@ -1023,7 +1023,7 @@ async function post(ev?: MouseEvent) {
 				'https://open.spotify.com/track/7anfcaNPQWlWCwyCHmZqNy',
 				'https://open.spotify.com/track/5Odr16TvEN4my22K9nbH7l',
 				'https://open.spotify.com/album/5bOlxyl4igOrp2DwVQxBco',
-			].some(url => text.includes(url))) {
+			].some(webUrl => text.includes(webUrl))) {
 				claimAchievement('brainDiver');
 			}
 
-- 
cgit v1.2.3-freya

