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