Fix: settings.appearance may be undefined
This commit is contained in:
parent
8adf7ca155
commit
0fda900ccc
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user