Skip to content

Commit

Permalink
fix discord_desktop_core
Browse files Browse the repository at this point in the history
  • Loading branch information
GregVido committed Sep 16, 2023
1 parent 0ef1ea4 commit 3f518aa
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions controller/js/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,30 @@ window.onload = async () => {
return output;
}


let getDiscordDesktopPath = () => {
const PATH = process.env.LOCALAPPDATA + '\\Discord\\' + getLastDiscordVersion() + '\\modules';
const files = fs.readdirSync(PATH);

for (let file of files) {
if (file.startsWith('discord_desktop_core'))
return PATH + '\\' + file + '\\discord_desktop_core\\';
}

return PATH;
}

getLastDiscordVersion();

const discord = process.env.LOCALAPPDATA + '\\Discord\\' + getLastDiscordVersion() + '\\modules\\discord_desktop_core-1\\discord_desktop_core\\';
const discord = getDiscordDesktopPath();

const net = require('net');

Object.values(menuBts).map((btn, i) => {
btn.addEventListener('click', () => {
Object.values(sections).map((section) => {
section.style.animation = '200ms fadeout';
if(section.classList.contains('visible')) {
if (section.classList.contains('visible')) {
setTimeout(() => {
section.classList.remove('visible');
}, 200 - 5);
Expand Down

0 comments on commit 3f518aa

Please sign in to comment.