move refresh ws to store.

This commit is contained in:
Miroslav Šedivý 2022-11-19 15:46:27 +01:00
parent 472a3c3355
commit 04cd943eb4
2 changed files with 2 additions and 9 deletions

View File

@ -72,14 +72,6 @@ export class NekoClient extends BaseClient implements EventEmitter<NekoEvents> {
})
}
public refreshFiles() {
if (!this.connected) {
this.emit('warn', 'attempting to refresh files while disconnected')
}
this.emit('debug', `sending event '${EVENT.FILETRANSFER.REFRESH}'`)
this._ws!.send(JSON.stringify({ event: EVENT.FILETRANSFER.REFRESH }))
}
/////////////////////////////
// Internal Events
/////////////////////////////

View File

@ -1,5 +1,6 @@
import { actionTree, getterTree, mutationTree } from 'typed-vuex'
import { FileListItem, FileTransfer } from '~/neko/types'
import { EVENT } from '~/neko/events'
import { accessor } from '~/store'
export const state = () => ({
@ -65,7 +66,7 @@ export const actions = actionTree(
if (!accessor.connected) {
return
}
$client.refreshFiles()
$client.sendMessage(EVENT.FILETRANSFER.REFRESH)
}
}
)