refactor: use gin_helper::Dictionary::CreateEmpty() helper (#40140)

This commit is contained in:
Milan Burda 2023-10-10 12:45:44 +02:00 committed by GitHub
parent 47beca1d2a
commit 563c370d51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 30 additions and 42 deletions

View file

@ -246,8 +246,7 @@ void FileChooserDialog::OnFileDialogResponse(GtkWidget* widget, int response) {
v8::Isolate* isolate = electron::JavascriptEnvironment::GetIsolate();
v8::HandleScope scope(isolate);
if (save_promise_) {
gin_helper::Dictionary dict =
gin::Dictionary::CreateEmpty(save_promise_->isolate());
auto dict = gin_helper::Dictionary::CreateEmpty(save_promise_->isolate());
if (response == GTK_RESPONSE_ACCEPT) {
dict.Set("canceled", false);
dict.Set("filePath", GetFileName());
@ -257,8 +256,7 @@ void FileChooserDialog::OnFileDialogResponse(GtkWidget* widget, int response) {
}
save_promise_->Resolve(dict);
} else if (open_promise_) {
gin_helper::Dictionary dict =
gin::Dictionary::CreateEmpty(open_promise_->isolate());
auto dict = gin_helper::Dictionary::CreateEmpty(open_promise_->isolate());
if (response == GTK_RESPONSE_ACCEPT) {
dict.Set("canceled", false);
dict.Set("filePaths", GetFileNames());