remove legacy code
This commit is contained in:
+11
-20
@@ -13,32 +13,23 @@ import "__patches__"; // auto generated by the build script
|
||||
|
||||
export * as Components from "./components";
|
||||
|
||||
import { VesktopSettingsIcon } from "@vencord/types/components";
|
||||
|
||||
import SettingsUi from "./components/settings/Settings";
|
||||
import { VesktopLogger } from "./logger";
|
||||
import { Settings } from "./settings";
|
||||
export { Settings };
|
||||
|
||||
import type SettingsPlugin from "@vencord/types/plugins/_core/settings";
|
||||
|
||||
VesktopLogger.log("read if cute :3");
|
||||
VesktopLogger.log("Vesktop v" + VesktopNative.app.getVersion());
|
||||
|
||||
// TODO
|
||||
const customSettingsSections = (Vencord.Plugins.plugins.Settings as typeof SettingsPlugin).customSections;
|
||||
const SettingsPlugin = Vencord.Plugins.plugins
|
||||
.Settings as typeof import("@vencord/types/plugins/_core/settings").default;
|
||||
|
||||
customSettingsSections.push(() => ({
|
||||
section: "Vesktop",
|
||||
label: "Vesktop Settings",
|
||||
element: SettingsUi,
|
||||
className: "vc-vesktop-settings"
|
||||
}));
|
||||
|
||||
// TODO: remove this legacy workaround once some time has passed
|
||||
if (!Vencord.Api.Styles.vencordRootNode) {
|
||||
const style = document.createElement("style");
|
||||
style.id = "vesktop-css-core";
|
||||
|
||||
VesktopNative.app.getRendererCss().then(css => (style.textContent = css));
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => document.documentElement.append(style), { once: true });
|
||||
}
|
||||
SettingsPlugin.customEntries.push({
|
||||
key: "vesktop",
|
||||
title: "Vesktop",
|
||||
panelTitle: "Vesktop Settings",
|
||||
Component: SettingsUi,
|
||||
Icon: VesktopSettingsIcon
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user