aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-31 17:17:54 +0100
committerVendicated <vendicated@riseup.net>2022-10-31 17:17:54 +0100
commit0fda900ccc5c7c4560a911b028d53faece620bfc (patch)
tree165811b3adcdf09baea69bdcfb5ba280b1c785d5
parent8adf7ca155a7f2b9d59ecfcc98ca47d123a26f59 (diff)
downloadVencord-0fda900ccc5c7c4560a911b028d53faece620bfc.tar.gz
Vencord-0fda900ccc5c7c4560a911b028d53faece620bfc.tar.bz2
Vencord-0fda900ccc5c7c4560a911b028d53faece620bfc.zip
Fix: settings.appearance may be undefined
-rw-r--r--src/components/Monaco.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/components/Monaco.ts b/src/components/Monaco.ts
index e147159..f40db77 100644
--- a/src/components/Monaco.ts
+++ b/src/components/Monaco.ts
@@ -33,10 +33,12 @@ export async function launchMonacoEditor() {
win.setCss = setCss;
win.getCurrentCss = () => VencordNative.ipc.invoke(IpcEvents.GET_QUICK_CSS);
- win.getTheme = () => find(m => m.ProtoClass?.typeName.endsWith("PreloadedUserSettings"))
- .getCurrentValue().appearance.theme === 1
- ? "vs-dark"
- : "vs-light";
+ win.getTheme = () =>
+ find(m =>
+ m.ProtoClass?.typeName.endsWith("PreloadedUserSettings")
+ )?.getCurrentValue()?.appearance?.theme === 2
+ ? "vs-light"
+ : "vs-dark";
win.document.write(monacoHtml);
}