提交 3b17ace4 authored 作者: Will Chen's avatar Will Chen

Actually call the move to downloads folder function

上级 a4df043a
...@@ -12,6 +12,8 @@ log.errorHandler.startCatching(); ...@@ -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) { ...@@ -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() { ...@@ -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> { ...@@ -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");
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论