Fix: settings.appearance may be undefined
This commit is contained in:
parent
8adf7ca155
commit
0fda900ccc
1 changed files with 6 additions and 4 deletions
|
@ -33,10 +33,12 @@ export async function launchMonacoEditor() {
|
||||||
|
|
||||||
win.setCss = setCss;
|
win.setCss = setCss;
|
||||||
win.getCurrentCss = () => VencordNative.ipc.invoke(IpcEvents.GET_QUICK_CSS);
|
win.getCurrentCss = () => VencordNative.ipc.invoke(IpcEvents.GET_QUICK_CSS);
|
||||||
win.getTheme = () => find(m => m.ProtoClass?.typeName.endsWith("PreloadedUserSettings"))
|
win.getTheme = () =>
|
||||||
.getCurrentValue().appearance.theme === 1
|
find(m =>
|
||||||
? "vs-dark"
|
m.ProtoClass?.typeName.endsWith("PreloadedUserSettings")
|
||||||
: "vs-light";
|
)?.getCurrentValue()?.appearance?.theme === 2
|
||||||
|
? "vs-light"
|
||||||
|
: "vs-dark";
|
||||||
|
|
||||||
win.document.write(monacoHtml);
|
win.document.write(monacoHtml);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue