2019-07-10 04:01:15 +00:00
|
|
|
/*
|
|
|
|
* @project: TERA
|
|
|
|
* @version: Development (beta)
|
|
|
|
* @license: MIT (not for evil)
|
|
|
|
* @copyright: Yuriy Ivanov (Vtools) 2017-2019 [progr76@gmail.com]
|
|
|
|
* Web: https://terafoundation.org
|
|
|
|
* Twitter: https://twitter.com/terafoundation
|
|
|
|
* Telegram: https://t.me/terafoundation
|
|
|
|
*/
|
|
|
|
|
|
|
|
const ipcRenderer = require('electron').ipcRenderer;
|
|
|
|
|
2019-07-10 09:53:52 +00:00
|
|
|
function GetDataElectron(Method, ObjPost, Func) {
|
|
|
|
if (Func === undefined) {
|
2019-07-10 04:01:15 +00:00
|
|
|
Func = ObjPost;
|
|
|
|
ObjPost = null;
|
|
|
|
}
|
|
|
|
var reply;
|
2019-07-10 09:53:52 +00:00
|
|
|
try {
|
|
|
|
reply = ipcRenderer.sendSync('GetData', { path: Method, obj: ObjPost });
|
2019-07-10 04:01:15 +00:00
|
|
|
}
|
2019-07-10 09:53:52 +00:00
|
|
|
catch (e) {
|
2019-07-10 04:01:15 +00:00
|
|
|
reply = undefined;
|
|
|
|
}
|
2019-07-10 09:53:52 +00:00
|
|
|
if (Func)
|
2019-07-10 04:01:15 +00:00
|
|
|
Func(reply);
|
|
|
|
};
|
|
|
|
window.GetData = GetDataElectron;
|