fix: explicitly assign a value to cancelId for ‘Clear All Data' dialog (#1624)

This commit is contained in:
Eric Zhu
2024-11-16 17:25:41 +08:00
committed by GitHub
parent 9ec3fe562b
commit fdb87cf5cd
+3 -1
View File
@@ -7,6 +7,7 @@ import { promisify } from "node:util"
import { callWindowExpose } from "@follow/shared/bridge"
import { app, dialog } from "electron"
import { getIconPath } from "~/helper"
import { logger } from "~/logger"
import { getMainWindow } from "~/window"
@@ -23,9 +24,10 @@ export const clearAllDataAndConfirm = async () => {
// Dialog to confirm
const result = await dialog.showMessageBox({
type: "warning",
icon: getIconPath(),
message: t("dialog.clearAllData"),
buttons: [t("dialog.yes"), t("dialog.no")],
cancelId: 1,
})
if (result.response === 1) {