add auto-updater
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user