diff --git a/ng-app/src/lib/components/CopyToClipboard.svelte b/ng-app/src/lib/components/CopyToClipboard.svelte
index b30efae3..49f226d2 100644
--- a/ng-app/src/lib/components/CopyToClipboard.svelte
+++ b/ng-app/src/lib/components/CopyToClipboard.svelte
@@ -4,11 +4,21 @@
let has_success: boolean = false;
+ const tauri_platform = import.meta.env.TAURI_PLATFORM;
+ const setClipboard = async (text: string) => {
+ if (tauri_platform) {
+ // TODO: this won't work for tauri platform.
+ // const { writeText } = await import("@tauri-apps/api/clipboard");
+ // await writeText(text);
+ } else {
+ navigator.clipboard.writeText(text);
+ }
+ };
+
const on_click = (e) => {
has_success = true;
setTimeout(() => (has_success = false), 2_000);
-
- navigator.clipboard.writeText(value);
+ setClipboard(value);
};
@@ -22,44 +32,46 @@
disabled
readonly
/>
-
+
+
+
+
+
+ {/if}
diff --git a/ng-app/src/routes/WalletCreate.svelte b/ng-app/src/routes/WalletCreate.svelte
index 2373c9bd..5181901f 100644
--- a/ng-app/src/routes/WalletCreate.svelte
+++ b/ng-app/src/routes/WalletCreate.svelte
@@ -10,6 +10,7 @@
-->