diff --git a/src/components/ShareModal.vue b/src/components/ShareModal.vue
index 908c307b..87cdec60 100644
--- a/src/components/ShareModal.vue
+++ b/src/components/ShareModal.vue
@@ -14,7 +14,7 @@
-
+
@@ -68,10 +68,18 @@ export default {
event.preventDefault();
},
followLink() {
- window.location.href = this.generatedLink;
+ window.open(this.generatedLink, "_blank").focus();
},
- copyLink() {
- this.$emit("close");
+ async copyLink() {
+ await this.copyURL(this.generatedLink);
+ },
+ async copyURL(mytext) {
+ try {
+ await navigator.clipboard.writeText(mytext);
+ alert(this.$t("info.copied"));
+ } catch ($e) {
+ alert(this.$t("info.cannot_copy"));
+ }
},
},
computed: {
diff --git a/src/locales/en.json b/src/locales/en.json
index 028effbc..3eacdaa8 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -149,6 +149,8 @@
},
"info": {
"preferences_note": "Note: preferences are saved in the local storage of your browser. Deleting your browser data will reset them.",
- "page_not_found": "Page not found"
+ "page_not_found": "Page not found",
+ "copied": "Copied!",
+ "cannot_copy": "Can't copy!"
}
}