Make clicking notifications focus VC Desktop
This commit is contained in:
11
src/renderer/fixes.ts
Normal file
11
src/renderer/fixes.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// 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
|
||||
});
|
||||
Reference in New Issue
Block a user