Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix[tauri]: paste macro links (#2915)

Peter Chinmanb1906861c310
diff --git a/js/app/packages/core/component/LexicalMarkdown/plugins/text-paste/textPastePlugin.ts b/js/app/packages/core/component/LexicalMarkdown/plugins/text-paste/textPastePlugin.ts
index 641dfde981..7a289271df 100644
--- a/js/app/packages/core/component/LexicalMarkdown/plugins/text-paste/textPastePlugin.ts
+++ b/js/app/packages/core/component/LexicalMarkdown/plugins/text-paste/textPastePlugin.ts
@@ -1,9 +1,10 @@
import {
- BlockAliasRegistry,
- BlockRegistry,
type BlockAlias,
+ BlockAliasRegistry,
type BlockName,
+ BlockRegistry,
} from '@core/block';
+import { isTauri } from '@core/util/platform';
import { mergeRegister } from '@lexical/utils';
import { parseThemeV1Json } from '@theme/utils/themeValidation';
import {
@@ -51,6 +52,12 @@ function isValidMentionHostname(hostname: string): boolean {
) {
return true;
}
+ // On Tauri, window.location.hostname is 'localhost', but Macro links are
+ // built with the real web origin (macro.com or dev.macro.com). Accept any
+ // recognized Macro host when running inside the native Tauri app.
+ if (isTauri() && current === Hosts.Localhost) {
+ return target === Hosts.Prod || target === Hosts.Dev;
+ }
return false;
}