chore: refine Next.js configuration and improve error handling
- Simplified the Next.js webpack configuration to apply raw-loader for markdown files universally. - Updated build script in package.json to ensure webpack is used during the build process. - Enhanced error logging across various hooks to provide clearer messages when exceptions occur, improving debugging capabilities.
This commit is contained in:
1 parent
655d9c1b45
commit
55749c07e3
12 files changed
+44
-37
No files matched your search
@@ -87,23 +87,18 @@ export function useAppUpdater(): AppUpdaterState {
|
||||
const update = await checkForUpdate();
|
||||
|
||||
if (update?.available) {
|
||||
// Escutar progresso do download
|
||||
const unlisten = await update.on('download-progress', (progress: any) => {
|
||||
setDownloadProgress(progress.progress || 0);
|
||||
});
|
||||
|
||||
// Baixar e instalar atualização
|
||||
// O progresso pode ser monitorado via eventos do Tauri se necessário
|
||||
await update.downloadAndInstall();
|
||||
|
||||
unlisten();
|
||||
|
||||
// Reiniciar aplicativo após instalação
|
||||
await update.installAndRestart();
|
||||
|
||||
// Após downloadAndInstall(), o app será reiniciado automaticamente
|
||||
// Não é necessário chamar installAndRestart() que não existe na API
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to install update:', err);
|
||||
setError(err instanceof Error ? err.message : 'Erro ao instalar atualização');
|
||||
setIsDownloading(false);
|
||||
setDownloadProgress(0);
|
||||
}
|
||||
}, [updateAvailable]);
|
||||
|
||||
|
||||
Reference in new issue
Block a user