Actually call the move to downloads folder function

This commit is contained in:
Will Chen
2025-04-21 17:17:19 -07:00
parent a4df043a36
commit 3b17ace46b

View File

@@ -12,6 +12,8 @@ log.errorHandler.startCatching();
log.eventLogger.startLogging();
log.scope.labelPadding = false;
const logger = log.scope("main");
updateElectronApp(); // additional configuration options available
// Load environment variables from .env file
@@ -25,6 +27,12 @@ if (started) {
app.quit();
}
export async function onReady() {
await onFirstRunMaybe();
}
app.whenReady().then(onReady);
/**
* Is this the first run of Fiddle? If so, perform
* tasks that we only want to do in this case.
@@ -46,6 +54,7 @@ export async function onFirstRunMaybe() {
async function promptMoveToApplicationsFolder(): Promise<void> {
if (process.platform !== "darwin") return;
if (app.isInApplicationsFolder()) return;
logger.log("Prompting user to move to applications folder");
const { response } = await dialog.showMessageBox({
type: "question",
@@ -55,7 +64,10 @@ async function promptMoveToApplicationsFolder(): Promise<void> {
});
if (response === 0) {
logger.log("User chose to move to applications folder");
app.moveToApplicationsFolder();
} else {
logger.log("User chose not to move to applications folder");
}
}