fix: reverse saveDialog cancellation bool (#18366)

This commit is contained in:
Shelley Vohr 2019-05-21 08:51:59 -07:00 committed by Charles Kerr
parent 1a2ab11c90
commit e39c76bfe1

View file

@ -117,7 +117,7 @@ void RunSaveDialogInNewThread(const RunState& run_state,
bool result = ShowSaveDialogSync(settings, &path);
run_state.ui_task_runner->PostTask(
FROM_HERE,
base::BindOnce(&OnSaveDialogDone, std::move(promise), result, path));
base::BindOnce(&OnSaveDialogDone, std::move(promise), !result, path));
run_state.ui_task_runner->DeleteSoon(FROM_HERE, run_state.dialog_thread);
}
@ -321,7 +321,7 @@ void ShowSaveDialog(const DialogSettings& settings,
RunState run_state;
if (!CreateDialogThread(&run_state)) {
mate::Dictionary dict = mate::Dictionary::CreateEmpty(promise.isolate());
dict.Set("canceled", false);
dict.Set("canceled", true);
dict.Set("filePath", base::FilePath());
promise.Resolve(dict.GetHandle());
} else {