From c1b5322124e0eab7c781275307fcd79d94a85070 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Tue, 18 May 2021 14:12:29 +0100 Subject: [PATCH] Remove colour codes from title --- src/api.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api.ts b/src/api.ts index 28e3977..e101191 100644 --- a/src/api.ts +++ b/src/api.ts @@ -38,6 +38,8 @@ import {useStore} from "@/store"; import ChatError from "@/errors/ChatError"; import {LiveAtlasServerDefinition} from "@/index"; +const titleColours = /ยง[0-9a-f]/ig; + function buildServerConfig(response: any): DynmapServerConfig { return { version: response.dynmapversion || '', @@ -49,7 +51,7 @@ function buildServerConfig(response: any): DynmapServerConfig { followZoom: response.followzoom || 0, updateInterval: response.updaterate || 3000, showLayerControl: response.showlayercontrol || true, - title: response.title || 'Dynmap', + title: response.title.replace(titleColours, '') || 'Dynmap', loginEnabled: response['login-enabled'] || false, maxPlayers: response.maxcount || 0, expandUI: response.sidebaropened && response.sidebaropened !== 'false',