Vesktop/src/renderer/fixes.ts

21 lines
592 B
TypeScript
Raw Normal View History

2023-04-05 05:31:44 +02:00
import "./hideGarbage.css";
import { isFirstRun } from "./utilts";
2023-04-05 05:31:44 +02:00
// Make clicking Notifications focus the window
const originalSetOnClick = Object.getOwnPropertyDescriptor(Notification.prototype, "onclick")!.set!;
Object.defineProperty(Notification.prototype, "onclick", {
set(onClick) {
originalSetOnClick.call(this, function () {
onClick.apply(this, arguments);
VencordDesktop.win.focus();
});
},
configurable: true
});
if (isFirstRun) {
Vencord.Webpack.waitFor("setDesktopType", m => {
m.setDesktopType("all");
});
}