From d654098ea072c55015a5cf5859b98e885e63d309 Mon Sep 17 00:00:00 2001 From: Renaud Heluin Date: Sat, 31 Aug 2024 10:52:22 +0200 Subject: [PATCH] fix: not handling error on fixing rights Nouvelle initialisation de l'application #47 --- .../ecoindex-app/src/main/handlers/Initalization.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/electron-app/ecoindex-app/src/main/handlers/Initalization.ts b/electron-app/ecoindex-app/src/main/handlers/Initalization.ts index aa94a85..1c7f396 100644 --- a/electron-app/ecoindex-app/src/main/handlers/Initalization.ts +++ b/electron-app/ecoindex-app/src/main/handlers/Initalization.ts @@ -162,6 +162,19 @@ export const initialization = async ( initializedDatas.initSudoFixNpmDirRights = getSudoFixNpmDirRightsReturned.result as boolean mainLog.log(getSudoFixNpmDirRightsReturned) + if (getSudoFixNpmDirRightsReturned.error) { + const cantFixUserRights = new ConfigData( + 'app_can_not_be_launched', + 'error_type_cant_fix_user_rights' + ) + cantFixUserRights.error = `Error on fixing user rights` + cantFixUserRights.message = `Need to fix user rights on ${os.platform()}` + getMainWindow().webContents.send( + channels.INITIALIZATION_DATAS, + cantFixUserRights + ) + return false + } } else if ( os.platform() !== 'darwin' && !initializedDatas.initPluginCanInstall