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() {
|
||||
// check for clipboard permissions
|
||||
navigator.permissions
|
||||
.query({ name: "clipboard-write" })
|
||||
.then(({ state }) => {
|
||||
if (state === "granted" || state === "prompt") {
|
||||
const url = window.location.href.split("#")[0];
|
||||
const link = url + "#" + this.session.sessionId;
|
||||
navigator.clipboard.writeText(link);
|
||||
}
|
||||
});
|
||||
const url = window.location.href.split("#")[0];
|
||||
const link = url + "#" + this.session.sessionId;
|
||||
navigator.clipboard.writeText(link);
|
||||
},
|
||||
distributeRoles() {
|
||||
if (this.session.isSpectator) return;
|
||||
|
|
|
@ -54,14 +54,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
copy: function() {
|
||||
// check for clipboard permissions
|
||||
navigator.permissions
|
||||
.query({ name: "clipboard-write" })
|
||||
.then(({ state }) => {
|
||||
if (state === "granted" || state === "prompt") {
|
||||
navigator.clipboard.writeText(this.input || this.gamestate);
|
||||
}
|
||||
});
|
||||
navigator.clipboard.writeText(this.input || this.gamestate);
|
||||
},
|
||||
load: function() {
|
||||
if (this.session.isSpectator) return;
|
||||
|
|
Loading…
Reference in New Issue