Skip to content

Commit 83dcc6b

Browse files
Catch deleteAppStartupCodeFile errors, added uninstaller for Translucence theme
1 parent d8ae7ee commit 83dcc6b

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

client/pages/main/script.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ ipcRenderer.on("executeScript", (_, { roomId, password, scriptContent } = {}) =>
180180
eval("(async () => (" + func.toString() + ")())();");
181181
return appStartupCodeFileId;
182182
},
183-
deleteAppStartupCodeFile: (appStartupCodeFileId) => fs.unlinkSync(path.join(process.resourcesPath, "appStartupCode/" + appStartupCodeFileId + ".js"))
183+
deleteAppStartupCodeFile: (appStartupCodeFileId) => {
184+
try {
185+
fs.unlinkSync(path.join(process.resourcesPath, "appStartupCode/" + appStartupCodeFileId + ".js"));
186+
} catch {};
187+
}
184188
}) {
185189
eval("(async () => {" + scriptContent + "})();");
186190
};
@@ -405,7 +409,11 @@ fs.readdirSync(path.join(process.resourcesPath, "appStartupCode")).forEach((appS
405409
eval("(async () => (" + func.toString() + ")())();");
406410
return appStartupCodeFileId;
407411
},
408-
deleteAppStartupCodeFile: (appStartupCodeFileId) => fs.unlinkSync(path.join(process.resourcesPath, "appStartupCode/" + appStartupCodeFileId + ".js"))
412+
deleteAppStartupCodeFile: (appStartupCodeFileId) => {
413+
try {
414+
fs.unlinkSync(path.join(process.resourcesPath, "appStartupCode/" + appStartupCodeFileId + ".js"));
415+
} catch {};
416+
}
409417
}) {
410418
eval("(async () => (" + fs.readFileSync(path.join(process.resourcesPath, "appStartupCode/" + appStartupCodeFile), "utf8") + ")())();");
411419
};

server/apps/code/e147a27e.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
createAppStartupCodeFile(() => {
1+
localStorage.setItem("translucenceThemeId", createAppStartupCodeFile(() => {
22
const fs = require("fs");
3-
3+
44
document.body.style.backgroundSize = "100% 100%";
55
document.body.style.backgroundImage = "url(https://images.pexels.com/photos/443446/pexels-photo-443446.jpeg?auto=compress&cs=tinysrgb&w=1280)";
66
document.body.children[0].style.opacity = "0.965";
@@ -65,4 +65,4 @@ createAppStartupCodeFile(() => {
6565
document.getElementById("pageEmbed").contentWindow.document.getElementById("markdownEmbed").src = ((Object.keys(JSON.parse(fs.readFileSync(path.join(process.resourcesPath, "customServer.json"), "utf8"))).length) ? (JSON.parse(fs.readFileSync(path.join(process.resourcesPath, "customServer.json"), "utf8")).resourceProtocol + "//" + JSON.parse(fs.readFileSync(path.join(process.resourcesPath, "customServer.json"), "utf8")).resourceHostname + ((JSON.parse(fs.readFileSync(path.join(process.resourcesPath, "customServer.json"), "utf8")).resourcePort) ? (":" + JSON.parse(fs.readFileSync(path.join(process.resourcesPath, "customServer.json"), "utf8")).resourcePort) : "")) : (process.env.DEFAULT_RESOURCE_SERVER_PROTOCOL + "//" + process.env.DEFAULT_RESOURCE_SERVER_HOSTNAME + ((process.env.DEFAULT_RESOURCE_SERVER_PORT) ? (":" + process.env.DEFAULT_RESOURCE_SERVER_PORT) : ""))) + "/help/?darkMode=true";
6666
};
6767
});
68-
});
68+
}));

server/apps/code/fd772627.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
deleteAppStartupFile(localStorage.getItem("translucenceThemeId"));
2+
localStorage.removeItem("translucenceThemeId");

server/apps/icons/fd772627.png

51.1 KB
Loading

server/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"apps":{"e147a27e":{"iconExtension":"png","name":"Translucence Theme","description":"A translucent/frosted glass Remote Control theme","verified":true}},"feedback":[{"rating":5,"comment":"Great app, I love it!!!"},{"rating":4},{"rating":5,"comment":"Amazing support, good functionality."}, {"rating":5}]}
1+
{"apps":{"e147a27e":{"iconExtension":"png","name":"Translucence Theme","description":"A translucent/frosted glass Remote Control theme","verified":true},"fd772627":{"iconExtension":"png","name":"Translucence Theme Uninstaller","description":"Uninstaller for the Translucence Theme","verified":true}},"feedback":[{"rating":5,"comment":"Great app, I love it!!!"},{"rating":4},{"rating":5,"comment":"Amazing support, good functionality."},{"rating":5}]}

0 commit comments

Comments
 (0)