From 04cd943eb43bdce49c81e6fc55f0a669baa825b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sat, 19 Nov 2022 15:46:27 +0100 Subject: [PATCH] move refresh ws to store. --- client/src/neko/index.ts | 8 -------- client/src/store/files.ts | 3 ++- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/client/src/neko/index.ts b/client/src/neko/index.ts index dc4b5ee..eefa6d6 100644 --- a/client/src/neko/index.ts +++ b/client/src/neko/index.ts @@ -72,14 +72,6 @@ export class NekoClient extends BaseClient implements EventEmitter { }) } - 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 ///////////////////////////// diff --git a/client/src/store/files.ts b/client/src/store/files.ts index c4122af..19d7c75 100644 --- a/client/src/store/files.ts +++ b/client/src/store/files.ts @@ -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) } } )