Skip to content

Commit

Permalink
Added proxies to fix analytics calls (#205)
Browse files Browse the repository at this point in the history
* added proxies to fix analytics calls

* remove unnecessary changes
  • Loading branch information
Sanceilaks authored Jan 10, 2025
1 parent ef44708 commit 4ed9e52
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ const startCore = () => {

desktopCore = require('discord_desktop_core');

const desktopTTI = new Proxy({}, {
get: (target, prop) => {
if (typeof target[prop] === 'undefined') {
target[prop] = () => { };
}
return target[prop];
}
});

desktopCore.startup({
splashScreen: splash,
moduleUpdater,
Expand All @@ -75,7 +84,16 @@ const startCore = () => {
logger: {
initializeLogging: () => {},
ipcMainRendererLogger: () => {}
}
},
analytics: new Proxy({}, {
get: (target, prop) => {
if (prop === 'getDesktopTTI') return () => desktopTTI;
if (typeof target[prop] === 'undefined') {
target[prop] = () => { };
}
return target[prop];
}
})
});
};

Expand Down

0 comments on commit 4ed9e52

Please sign in to comment.