mirror of
https://github.com/ION606/browser-chromium.git
synced 2026-05-14 22:26:56 +00:00
13 lines
371 B
JavaScript
13 lines
371 B
JavaScript
|
|
import { dialog } from 'electron';
|
||
|
|
|
||
|
|
export async function askUserQuestion(window, title, question) {
|
||
|
|
const response = await dialog.showMessageBox(window, {
|
||
|
|
buttons: ['Yes', 'No'],
|
||
|
|
defaultId: 0,
|
||
|
|
cancelId: 1,
|
||
|
|
title,
|
||
|
|
message: question,
|
||
|
|
});
|
||
|
|
|
||
|
|
return response.response === 0; // true if 'Yes' was clicked, false if 'No'
|
||
|
|
}
|