mirror of https://github.com/bra1n/townsquare.git
fix copy to clipboard not working in firefox
This commit is contained in:
parent
7b1a264498
commit
84f73ceb01
|
@ -238,16 +238,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
copySessionUrl() {
|
copySessionUrl() {
|
||||||
// check for clipboard permissions
|
const url = window.location.href.split("#")[0];
|
||||||
navigator.permissions
|
const link = url + "#" + this.session.sessionId;
|
||||||
.query({ name: "clipboard-write" })
|
navigator.clipboard.writeText(link);
|
||||||
.then(({ state }) => {
|
|
||||||
if (state === "granted" || state === "prompt") {
|
|
||||||
const url = window.location.href.split("#")[0];
|
|
||||||
const link = url + "#" + this.session.sessionId;
|
|
||||||
navigator.clipboard.writeText(link);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
distributeRoles() {
|
distributeRoles() {
|
||||||
if (this.session.isSpectator) return;
|
if (this.session.isSpectator) return;
|
||||||
|
|
|
@ -54,14 +54,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
copy: function() {
|
copy: function() {
|
||||||
// check for clipboard permissions
|
navigator.clipboard.writeText(this.input || this.gamestate);
|
||||||
navigator.permissions
|
|
||||||
.query({ name: "clipboard-write" })
|
|
||||||
.then(({ state }) => {
|
|
||||||
if (state === "granted" || state === "prompt") {
|
|
||||||
navigator.clipboard.writeText(this.input || this.gamestate);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
load: function() {
|
load: function() {
|
||||||
if (this.session.isSpectator) return;
|
if (this.session.isSpectator) return;
|
||||||
|
|
Loading…
Reference in New Issue