From f21faa379846f06b3baf43f9d79ea72d07fb8cf8 Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Sat, 16 Dec 2023 12:56:28 +0100 Subject: [PATCH] fix default theme --- src/FileManagement.ts | 2 +- src/main.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/FileManagement.ts b/src/FileManagement.ts index 145b3d1..e7fee20 100644 --- a/src/FileManagement.ts +++ b/src/FileManagement.ts @@ -136,7 +136,7 @@ export class AppSettings { */ public vimMode: boolean = false; - public theme: string = "toposTheme"; + public theme: string = "Dracula"; public font: string = "IBM Plex Mono"; public font_size: number = 24; public universes: Universes; diff --git a/src/main.ts b/src/main.ts index ff2aa29..d5cc11d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -210,7 +210,13 @@ export class Editor { loadUniverserFromUrl(this); // Set the color scheme for the application - this.readTheme(this.settings.theme); + let available_themes = Object.keys(colors); + if (this.settings.theme in available_themes) { + this.readTheme(this.settings.theme); + } else { + this.settings.theme = "Dracula"; + this.readTheme(this.settings.theme); + } } private getBuffer(type: string): any {