Replaced electron-settings with store. Implemented job upsert logic.
This commit is contained in:
@@ -4,7 +4,6 @@ import {
|
||||
setWatcherStatus,
|
||||
} from "../redux/application/application.actions";
|
||||
import { store } from "../redux/store";
|
||||
import { message } from "antd";
|
||||
import { UpsertEstimate } from "./ipc-estimate-utils";
|
||||
|
||||
const { ipcRenderer } = window;
|
||||
@@ -16,7 +15,7 @@ ipcRenderer.on("test-toRenderer", (event, obj) => {
|
||||
|
||||
ipcRenderer.on(
|
||||
ipcTypes.default.fileWatcher.toRenderer.filepathsList,
|
||||
(event, ...obj) => {
|
||||
(event, obj) => {
|
||||
store.dispatch(setWatchedPaths(obj));
|
||||
}
|
||||
);
|
||||
@@ -24,37 +23,32 @@ ipcRenderer.on(
|
||||
//Filewatcher Status Section
|
||||
ipcRenderer.on(
|
||||
ipcTypes.default.fileWatcher.toRenderer.startSuccess,
|
||||
(event, ...obj) => {
|
||||
console.log("Watcher ready.");
|
||||
message.success("Watcher started!");
|
||||
store.dispatch(setWatcherStatus("READY!"));
|
||||
(event, obj) => {
|
||||
store.dispatch(setWatcherStatus("Started"));
|
||||
}
|
||||
);
|
||||
ipcRenderer.on(
|
||||
ipcTypes.default.fileWatcher.toRenderer.stopSuccess,
|
||||
(event, ...obj) => {
|
||||
store.dispatch(setWatcherStatus("STOPPED"));
|
||||
}
|
||||
);
|
||||
ipcRenderer.on(
|
||||
ipcTypes.default.fileWatcher.toRenderer.error,
|
||||
(event, ...obj) => {
|
||||
store.dispatch(setWatcherStatus(obj));
|
||||
(event, obj) => {
|
||||
store.dispatch(setWatcherStatus("Stopped"));
|
||||
}
|
||||
);
|
||||
ipcRenderer.on(ipcTypes.default.fileWatcher.toRenderer.error, (event, obj) => {
|
||||
store.dispatch(setWatcherStatus(obj));
|
||||
});
|
||||
|
||||
//Estimate Section
|
||||
ipcRenderer.on(
|
||||
ipcTypes.default.estimate.toRenderer.estimateDecodeStart,
|
||||
(event, ...obj) => {
|
||||
(event, obj) => {
|
||||
console.log("Decoding started!");
|
||||
}
|
||||
);
|
||||
|
||||
ipcRenderer.on(
|
||||
ipcTypes.default.estimate.toRenderer.estimateDecodeSuccess,
|
||||
async (event, ...obj) => {
|
||||
console.log("Decoding success!", obj[0]);
|
||||
await UpsertEstimate(obj[0]);
|
||||
async (event, obj) => {
|
||||
console.log("obj", obj);
|
||||
await UpsertEstimate(obj);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user