mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 10:12:11 +00:00
Require confirmation for desktop reinstall (#1835)
* Add generic default button for unknown dialogs * Add reinstall confirmation dialog * Prevent removal of newlines in i18n dialogs * Update locales [skip ci] --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { t } from '@/i18n'
|
||||
import { app } from '@/scripts/app'
|
||||
import { showConfirmationDialog } from '@/services/dialogService'
|
||||
import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
||||
;(async () => {
|
||||
if (!isElectron()) return
|
||||
@@ -101,11 +103,16 @@ import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
||||
},
|
||||
{
|
||||
id: 'Comfy-Desktop.Reinstall',
|
||||
label: 'Reinstall',
|
||||
label: t('desktopMenu.reinstall'),
|
||||
icon: 'pi pi-refresh',
|
||||
function() {
|
||||
// TODO(huchenlei): Add a confirmation dialog.
|
||||
electronAPI.reinstall()
|
||||
async function() {
|
||||
const proceed = await showConfirmationDialog({
|
||||
message: t('desktopMenu.confirmReinstall'),
|
||||
title: t('desktopMenu.reinstall'),
|
||||
type: 'reinstall'
|
||||
})
|
||||
|
||||
if (proceed) electronAPI.reinstall()
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user