This repository has been archived on 2025-09-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
repertory-ui/src/renderer/ipc/SkynetIPC.js

48 lines
1.3 KiB
JavaScript

const Constants = require('../../constants');
const helpers = require('../../helpers');
const addListeners = (ipcMain, {standardIPCReply}) => {
ipcMain.on(Constants.IPC_Export_Skylinks, (event, data) => {
helpers
.exportSkylinks(data.Version, data.Paths)
.then(result => {
standardIPCReply(event, Constants.IPC_Export_Skylinks_Reply, {
Result: result,
});
})
.catch(error => {
standardIPCReply(event, Constants.IPC_Export_Skylinks_Reply, {}, error);
});
});
ipcMain.on(Constants.IPC_Grab_Skynet_Tree, (event, data) => {
helpers
.grabSkynetFileTree(data.Version)
.then(result => {
standardIPCReply(event, Constants.IPC_Grab_Skynet_Tree_Reply, {
Result: result,
});
})
.catch(error => {
standardIPCReply(event, Constants.IPC_Grab_Skynet_Tree_Reply, {}, error);
});
});
ipcMain.on(Constants.IPC_Import_Skylinks, (event, data) => {
helpers
.importSkylinks(data.Version, data.JsonArray)
.then(result => {
standardIPCReply(event, Constants.IPC_Import_Skylinks_Reply, {
Result: result,
});
})
.catch(error => {
standardIPCReply(event, Constants.IPC_Import_Skylinks_Reply, {}, error);
});
});
};
module.exports = {
addListeners
};