move refresh ws to store.
This commit is contained in:
parent
472a3c3355
commit
04cd943eb4
@ -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
|
||||
/////////////////////////////
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
Reference in New Issue
Block a user