Archived
2
0

clipboard sync and some minor fixes

This commit is contained in:
Craig
2020-01-25 14:29:52 +00:00
parent e3a73aa264
commit 56a5dcf77f
22 changed files with 359 additions and 88 deletions

View File

@ -7,6 +7,7 @@ export const namespaced = true
export const state = () => ({
id: '',
clipboard: '',
})
export const getters = getterTree(state, {
@ -30,8 +31,13 @@ export const mutations = mutationTree(state, {
}
},
setClipboard(state, clipboard: string) {
state.clipboard = clipboard
},
clear(state) {
state.id = ''
state.clipboard = ''
},
})
@ -41,6 +47,15 @@ export const actions = actionTree(
initialise({ commit }) {
//
},
sendClipboard({ getters }, clipboard: string) {
if (!accessor.connected || !getters.hosting) {
return
}
$client.sendMessage(EVENT.CONTROL.CLIPBOARD, { text: clipboard })
},
toggle({ getters }) {
if (!accessor.connected) {
return