Skip to content

Commit 426dfb1

Browse files
committed
wip: Only notify beta app if no dnt file
1 parent 6da467d commit 426dfb1

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

src/renderer/src/scripts/others/renderer.js

+16-11
Original file line numberDiff line numberDiff line change
@@ -499,17 +499,6 @@ const initializeSODARenderer = async () => {
499499
// Set the app version in the sidebar for the user to see
500500
setSidebarAppVersion();
501501

502-
// Warn the user if they are on a beta version of the app
503-
const warnUserIfBetaVersionAndDntNotEnabled = async () => {
504-
let currentAppVersion = await window.electron.ipcRenderer.invoke("app-version");
505-
if (currentAppVersion.includes("beta")) {
506-
await swalShowInfo(
507-
"You are on a beta version of SODA",
508-
"When you are finished using this special version of SODA, please download the latest stable version<a href='https://docs.sodaforsparc.io/' target='_blank'> by clicking here</a>"
509-
);
510-
}
511-
};
512-
513502
await warnUserIfBetaVersionAndDntNotEnabled();
514503

515504
// Launch announcements if the user has not seen them yet
@@ -988,6 +977,22 @@ const setSidebarAppVersion = async () => {
988977
version.innerText = currentAppVersion;
989978
};
990979

980+
// Warn the user if they are on a beta version of the app
981+
const warnUserIfBetaVersionAndDntNotEnabled = async () => {
982+
try {
983+
let currentAppVersion = await window.electron.ipcRenderer.invoke("app-version");
984+
const dntFilePath = window.path.join(homeDirectory, ".soda-config", "dnt.soda");
985+
if (currentAppVersion.includes("beta") && !window.fs.existsSync(dntFilePath)) {
986+
await swalShowInfo(
987+
"You are on a beta version of SODA",
988+
"When you are finished using this special version of SODA, please download the latest stable version<a href='https://docs.sodaforsparc.io/' target='_blank'> by clicking here</a>"
989+
);
990+
}
991+
} catch (err) {
992+
console.error("Error determing if beta pop up should exist:", err);
993+
}
994+
};
995+
991996
// Check app version on current app and display in the side bar
992997
window.electron.ipcRenderer.on("app_version", (event, arg) => {
993998
window.electron.ipcRenderer.removeAllListeners("app_version");

0 commit comments

Comments
 (0)