mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
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)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user