Skip to content

Commit 4ed9e52

Browse files
authored
Added proxies to fix analytics calls (#205)
* added proxies to fix analytics calls * remove unnecessary changes
1 parent ef44708 commit 4ed9e52

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

src/bootstrap.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ const startCore = () => {
5151

5252
desktopCore = require('discord_desktop_core');
5353

54+
const desktopTTI = new Proxy({}, {
55+
get: (target, prop) => {
56+
if (typeof target[prop] === 'undefined') {
57+
target[prop] = () => { };
58+
}
59+
return target[prop];
60+
}
61+
});
62+
5463
desktopCore.startup({
5564
splashScreen: splash,
5665
moduleUpdater,
@@ -75,7 +84,16 @@ const startCore = () => {
7584
logger: {
7685
initializeLogging: () => {},
7786
ipcMainRendererLogger: () => {}
78-
}
87+
},
88+
analytics: new Proxy({}, {
89+
get: (target, prop) => {
90+
if (prop === 'getDesktopTTI') return () => desktopTTI;
91+
if (typeof target[prop] === 'undefined') {
92+
target[prop] = () => { };
93+
}
94+
return target[prop];
95+
}
96+
})
7997
});
8098
};
8199

0 commit comments

Comments
 (0)