1
0
forked from noxious/client

added a bit of styling to character screen, listen for socket notifications

This commit is contained in:
2024-05-29 01:27:21 +02:00
parent 8cd0e9254a
commit 220c7a1d9c
2 changed files with 38 additions and 2 deletions

View File

@ -28,6 +28,12 @@ export const useSocketStore: StoreDefinition<any> = defineStore('socket', {
console.log("Reconnect failed")
this.disconnectSocket();
})
this.connection.on('notification', (data: any) => {
if(data.error) console.error(data.error);
if (data.success) console.log(data.success);
if (data.message) console.log(data.message);
});
},
disconnectSocket() {
if (!this.connection) return;