@fto-consult/expo-ui 7.4.26 → 7.4.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/electron/index.js +17 -2
- package/electron/preload.js +5 -7
- package/electron/tools.js +0 -0
- package/package.json +1 -1
package/electron/index.js
CHANGED
@@ -314,8 +314,8 @@ app.whenReady().then(() => {
|
|
314
314
|
})
|
315
315
|
|
316
316
|
ipcMain.on("electron-restart-app",x =>{app.relaunch();})
|
317
|
-
let tray = null;
|
318
|
-
let isJSON = function (json_string){
|
317
|
+
let tray = null;
|
318
|
+
let isJSON = function (json_string){
|
319
319
|
if(!json_string || typeof json_string != 'string') return false;
|
320
320
|
var text = json_string;
|
321
321
|
return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g, '')));
|
@@ -357,6 +357,21 @@ ipcMain.on("electron-get-path",(event,pathName)=>{
|
|
357
357
|
return p;
|
358
358
|
});
|
359
359
|
|
360
|
+
ipcMain.on("electron-get-project-root",(event)=>{
|
361
|
+
return projectRoot;
|
362
|
+
});
|
363
|
+
ipcMain.on("electron-get-electron-project-root",(event)=>{
|
364
|
+
return electronProjectRoot;
|
365
|
+
});
|
366
|
+
|
367
|
+
ipcMain.on("electron-get-package-json",(event)=>{
|
368
|
+
const packageJSON = path.resolve(projectRoot,"package.json");
|
369
|
+
if(fs.existsSync(packageJSON)){
|
370
|
+
return JSON.stringify(require(packageJSON));
|
371
|
+
}
|
372
|
+
return JSON.stringify({});
|
373
|
+
});
|
374
|
+
|
360
375
|
ipcMain.on("electron-get-media-access-status",(event,mediaType)=>{
|
361
376
|
let p = systemPreferences.getMediaAccessStatus(mediaType);
|
362
377
|
event.returnValue = p;
|
package/electron/preload.js
CHANGED
@@ -6,16 +6,14 @@ const path = require("path");
|
|
6
6
|
const fs = require("fs");
|
7
7
|
const isObj = x=>x && typeof x =='object' && !Array.isArray(x);
|
8
8
|
const isNonNullString = x=>x && typeof x =='string';
|
9
|
-
const
|
10
|
-
const
|
11
|
-
|
12
|
-
|
13
|
-
}
|
14
|
-
const _app = require(`${packagePath}`);
|
9
|
+
const packageJSONStr = ipcRenderer.sendSync("electron-get-package-json");
|
10
|
+
const projectRoot = ipcRenderer.sendSync("electron-get-electron-project-root");
|
11
|
+
const pathsJS = projectRoot && fs.existsSync(projectRoot) && path.resolve(projectRoot,"paths.json") || null;
|
12
|
+
const _app = packageJSONStr ? JSON.parse(packageJSONStr) : {};
|
15
13
|
if(!_app || typeof _app !=='object' || typeof _app.name !=='string'){
|
16
14
|
throw {message : "Contenu du fichier "+packagePath+" invalide!! Veuillez spécifier un nom valide d'application, propriété <<name>> dudit fichier"}
|
17
15
|
}
|
18
|
-
const paths = require(
|
16
|
+
const paths = pathsJS ? require(`${pathsJS}`) : {};
|
19
17
|
const APP_NAME = _app.name.trim().toUpperCase();
|
20
18
|
let backupPathField = "_e_backupDataPath";
|
21
19
|
let cBackupPathField = "company"+backupPathField;
|
File without changes
|