add auto-updater

This commit is contained in:
2026-09-08 17:33:55 +00:00
parent d1793cc11b
commit 8763226ccd
12 changed files with 685 additions and 29 deletions
+15 -2
View File
@@ -109,12 +109,20 @@ export function AppProvider({
/**
* Show a confirmation dialog and wait for user response.
*/
const confirm = useCallback((message: string): Promise<boolean> => {
const confirm = useCallback((
message: string,
options?: {
title?: string;
confirmLabel?: string;
cancelLabel?: string;
},
): Promise<boolean> => {
return new Promise((resolve) => {
setDialog({
visible: true,
type: 'confirm',
message,
...options,
onConfirm: () => {
setDialog(null);
resolve(true);
@@ -134,6 +142,11 @@ export function AppProvider({
setStatusState(message);
}, []);
const exit = useCallback(async () => {
await appService?.stop();
onExit();
}, [appService, onExit]);
const appValue: AppContextType = {
appService,
initializeWallet,
@@ -142,7 +155,7 @@ export function AppProvider({
showError,
showInfo,
confirm,
exit: onExit,
exit,
setStatus,
};