custom kick message, fixes #56.

This commit is contained in:
Miroslav Šedivý 2021-07-17 19:37:50 +02:00
parent b9b80ed79a
commit 122fd8b957
7 changed files with 16 additions and 4 deletions

View File

@ -72,6 +72,7 @@ export const connection = {
reconnecting: 'Reconnecting...',
connected: 'Connected',
disconnected: 'Disconnected',
kicked: 'You have been removed from this room.',
button_confirm: 'OK',
}

View File

@ -73,6 +73,8 @@ export const connection = {
//reconnecting: 'Reconnecting',
connected: 'Connectado correctamente',
disconnected: 'Has sido desconectado',
// TODO
//kicked: 'You have been removed from this room.',
button_confirm: 'De acuerdo',
}

View File

@ -73,6 +73,8 @@ export const connection = {
//reconnecting: 'Reconnecting',
connected: 'Connecté',
disconnected: 'Déconnecté',
// TODO
//kicked: 'You have been removed from this room.',
button_confirm: 'OK',
}

View File

@ -73,6 +73,8 @@ export const connection = {
//reconnecting: 'Reconnecting',
connected: 'Tilkoblet',
disconnected: 'Frakoblet',
// TODO
//kicked: 'You have been removed from this room.',
button_confirm: 'OK',
}

View File

@ -72,6 +72,7 @@ export const connection = {
reconnecting: 'Obnova spojenia...',
connected: 'Úspešne pripojený/á',
disconnected: 'Boli ste odpojený/á',
kicked: 'Boli ste odstránený/á z tejto miestnosti.',
button_confirm: 'Ok',
}

View File

@ -73,6 +73,8 @@ export const connection = {
//reconnecting: 'Reconnecting',
connected: 'Du har loggats in',
disconnected: 'Du har blivit frånkopplad',
// TODO
//kicked: 'You have been removed from this room.',
button_confirm: 'Ok',
}

View File

@ -105,10 +105,6 @@ export class NekoClient extends BaseClient implements EventEmitter<NekoEvents> {
protected [EVENT.DISCONNECTED](reason?: Error) {
this.cleanup()
if (reason && reason.message == 'kicked') {
this.$accessor.logout()
}
this.$vue.$notify({
group: 'neko',
type: 'error',
@ -135,7 +131,13 @@ export class NekoClient extends BaseClient implements EventEmitter<NekoEvents> {
// System Events
/////////////////////////////
protected [EVENT.SYSTEM.DISCONNECT]({ message }: DisconnectPayload) {
if (message == 'kicked') {
this.$accessor.logout()
message = this.$vue.$t('connection.kicked') as string
}
this.onDisconnected(new Error(message))
this.$vue.$swal({
title: this.$vue.$t('connection.disconnected'),
text: message,