diff --git a/electron/file-watcher/file-watcher-ipc.js b/electron/file-watcher/file-watcher-ipc.js
index 332aa7e..504cab2 100644
--- a/electron/file-watcher/file-watcher-ipc.js
+++ b/electron/file-watcher/file-watcher-ipc.js
@@ -2,14 +2,13 @@ const { ipcMain } = require("electron");
const { StartWatcher, StopWatcher } = require("./file-watcher");
const ipcTypes = require("../../src/ipc.types").default;
-ipcMain.on(ipcTypes.filewatcher.start, async (event, arg) => {
- console.log(ipcTypes.filewatcher.start);
+ipcMain.on(ipcTypes.fileWatcher.toMain.start, async (event, arg) => {
const filePaths = StartWatcher();
- event.sender.send(ipcTypes.filewatcher.startSuccess, filePaths);
+ event.sender.send(ipcTypes.fileWatcher.toRenderer.startSuccess, filePaths);
+ event.sender.send(ipcTypes.fileWatcher.toRenderer.filepathsList, filePaths);
});
-ipcMain.on(ipcTypes.filewatcher.stop, async (event, arg) => {
- console.log(ipcTypes.filewatcher.start);
+ipcMain.on(ipcTypes.fileWatcher.toMain.stop, async (event, arg) => {
StopWatcher();
- event.sender.send(ipcTypes.filewatcher.start, { success: true });
+ event.sender.send(ipcTypes.fileWatcher.toRenderer.stopSuccess);
});
diff --git a/electron/file-watcher/file-watcher.js b/electron/file-watcher/file-watcher.js
index 9792755..33e6528 100644
--- a/electron/file-watcher/file-watcher.js
+++ b/electron/file-watcher/file-watcher.js
@@ -1,6 +1,7 @@
const chokidar = require("chokidar");
-const { file } = require("electron-settings");
+const { ipcMain } = require("electron");
const settings = require("electron-settings");
+const { default: ipcTypes } = require("../../src/ipc.types");
var watcher;
@@ -34,6 +35,7 @@ function StartWatcher() {
})
.on("error", function (error) {
console.log("Error happened", error);
+ ipcMain.emit(ipcTypes.fileWatcher.toRenderer.error, error);
})
.on("ready", onWatcherReady)
.on("raw", function (event, path, details) {
@@ -44,14 +46,14 @@ function StartWatcher() {
}
function onWatcherReady() {
- console.info(
- "From here can you check for real changes, the initial scan has been completed."
- );
+ console.log("Ready!");
+ ipcMain.emit(ipcTypes.fileWatcher.toRenderer.startSuccess);
}
async function StopWatcher() {
await watcher.close();
- console.log("closed", watcher);
+ ipcMain.emit(ipcTypes.fileWatcher.toRenderer.stopSuccess);
+ console.log("Watcher Stopped!", watcher);
}
exports.StartWatcher = StartWatcher;
diff --git a/electron/ipc-handler.js b/electron/ipc-main-handler.js
similarity index 54%
rename from electron/ipc-handler.js
rename to electron/ipc-main-handler.js
index 3b26f57..7060c5e 100644
--- a/electron/ipc-handler.js
+++ b/electron/ipc-main-handler.js
@@ -2,27 +2,25 @@ const { ipcMain, dialog } = require("electron");
const { mainWindow } = require("./main");
const settings = require("electron-settings");
const { DecodeEstimate } = require("./decoder/decoder");
+const ipcTypes = require("../src/ipc.types");
//Import Ipc Handlers
require("./file-watcher/file-watcher-ipc");
console.log("*** Added IPC Handlers ***");
+ipcMain.on(
+ ipcTypes.default.fileWatcher.toMain.filepathsGet,
+ async (event, object) => {
+ const filePaths = await settings.get("filePaths");
+ event.reply(
+ ipcTypes.default.fileWatcher.toRenderer.filepathsList,
+ filePaths
+ );
+ }
+);
+
ipcMain.on("test", async (event, object) => {
console.log("Received test IPC Command");
const job = await DecodeEstimate("C:\\VPS\\EMS\\687_3_A.AD1");
-
event.reply("test-success", { status: 0, message: null, data: job });
});
-
-// ipcMain.on("test-start", async (event, arg) => {
-// console.log("Test Start Inbound.", arg);
-// const result = await dialog.showOpenDialog(mainWindow, {
-// properties: ["openDirectory"],
-// });
-// await settings.set("filePaths", [
-// ...result.filePaths,
-// ...(await settings.get("filePaths")),
-// ]);
-// console.log(await settings.get("filePaths"));
-// event.sender.send("test-success", { success: true });
-// });
diff --git a/electron/main.js b/electron/main.js
index 54ed746..e172924 100644
--- a/electron/main.js
+++ b/electron/main.js
@@ -3,7 +3,7 @@ const { app, BrowserWindow } = require("electron");
const isDev = require("electron-is-dev");
const settings = require("electron-settings");
-require("./ipc-handler");
+require("./ipc-main-handler");
// Conditionally include the dev tools installer to load React Dev Tools
let installExtension, REACT_DEVELOPER_TOOLS;
diff --git a/electron/preload.js b/electron/preload.js
index fa7f5f7..621d085 100644
--- a/electron/preload.js
+++ b/electron/preload.js
@@ -7,6 +7,7 @@ contextBridge.exposeInMainWorld("ipcRenderer", {
// whitelist channels
// let validChannels = ["toMain"];
// if (validChannels.includes(channel)) {
+ console.log("ipcRenderer Send", channel);
ipcRenderer.send(channel, data);
//}
},
diff --git a/src/App/App.jsx b/src/App/App.jsx
index a3f1b3e..837b21d 100644
--- a/src/App/App.jsx
+++ b/src/App/App.jsx
@@ -7,9 +7,9 @@ import { createStructuredSelector } from "reselect";
import RoutesPage from "../components/pages/routes/routes.page";
import SignInPage from "../components/pages/sign-in/sign-in.page";
import client from "../graphql/GraphQLClient";
+import "../ipc/ipc-renderer-handler";
import { checkUserSession } from "../redux/user/user.actions";
import { selectCurrentUser } from "../redux/user/user.selectors";
-import "../ipc/ipc-init";
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser,
diff --git a/src/components/atoms/watcher-status/watcher-status.atom.jsx b/src/components/atoms/watcher-status/watcher-status.atom.jsx
new file mode 100644
index 0000000..45fcd45
--- /dev/null
+++ b/src/components/atoms/watcher-status/watcher-status.atom.jsx
@@ -0,0 +1,23 @@
+import { Alert } from "antd";
+import React from "react";
+import { connect } from "react-redux";
+import { createStructuredSelector } from "reselect";
+import {
+ selectWatcherError,
+ selectWatcherStatus,
+} from "../../../redux/application/application.selectors";
+
+const mapStateToProps = createStructuredSelector({
+ watcherStatus: selectWatcherStatus,
+ watcherError: selectWatcherError,
+});
+
+export function WatcherStatusAtom({ watcherStatus, watcherError }) {
+ return (
+
+ {watcherStatus}
+ {watcherError &&
}
+
+ );
+}
+export default connect(mapStateToProps, null)(WatcherStatusAtom);
diff --git a/src/components/molecules/filepath-item/filepath-item.molecule.jsx b/src/components/molecules/filepath-item/filepath-item.molecule.jsx
new file mode 100644
index 0000000..3ad4325
--- /dev/null
+++ b/src/components/molecules/filepath-item/filepath-item.molecule.jsx
@@ -0,0 +1,6 @@
+import { List } from "antd";
+import React from "react";
+
+export default function FilePathMolecule(item) {
+ return {item};
+}
diff --git a/src/components/molecules/sider-sign-out/sider-sign-out.molecule.jsx b/src/components/molecules/sider-sign-out/sider-sign-out.molecule.jsx
index a527ac6..daed0b4 100644
--- a/src/components/molecules/sider-sign-out/sider-sign-out.molecule.jsx
+++ b/src/components/molecules/sider-sign-out/sider-sign-out.molecule.jsx
@@ -1,3 +1,4 @@
+import { UserOutlined } from "@ant-design/icons";
import { Menu } from "antd";
import React from "react";
import { connect } from "react-redux";
@@ -9,7 +10,11 @@ const mapDispatchToProps = (dispatch) => ({
export function SiderSignOut({ signOutStart, ...restProps }) {
return (
- signOutStart()}>
+ }
+ {...restProps}
+ onClick={() => signOutStart()}
+ >
Sign Out
);
diff --git a/src/components/molecules/watcher-start/watcher-start.molecule.jsx b/src/components/molecules/watcher-start/watcher-start.molecule.jsx
new file mode 100644
index 0000000..0867fb1
--- /dev/null
+++ b/src/components/molecules/watcher-start/watcher-start.molecule.jsx
@@ -0,0 +1,16 @@
+import { Button } from "antd";
+import React from "react";
+import ipcTypes from "../../../ipc.types";
+const { ipcRenderer } = window;
+
+export default function WatcherStartMolecule() {
+ const handleClick = () => {
+ ipcRenderer.send(ipcTypes.default.fileWatcher.toMain.start);
+ };
+
+ return (
+
+
+
+ );
+}
diff --git a/src/components/molecules/watcher-stop/watcher-stop.molecule.jsx b/src/components/molecules/watcher-stop/watcher-stop.molecule.jsx
new file mode 100644
index 0000000..1d20332
--- /dev/null
+++ b/src/components/molecules/watcher-stop/watcher-stop.molecule.jsx
@@ -0,0 +1,16 @@
+import { Button } from "antd";
+import React from "react";
+import ipcTypes from "../../../ipc.types";
+const { ipcRenderer } = window;
+
+export default function WatcherStopMolecule() {
+ const handleClick = () => {
+ ipcRenderer.send(ipcTypes.default.fileWatcher.toMain.stop);
+ };
+
+ return (
+
+
+
+ );
+}
diff --git a/src/components/organisms/filepaths-list/filepaths-list.organism.jsx b/src/components/organisms/filepaths-list/filepaths-list.organism.jsx
new file mode 100644
index 0000000..522e8a5
--- /dev/null
+++ b/src/components/organisms/filepaths-list/filepaths-list.organism.jsx
@@ -0,0 +1,30 @@
+import { List } from "antd";
+import React, { useEffect } from "react";
+import { connect } from "react-redux";
+import { createStructuredSelector } from "reselect";
+import ipcTypes from "../../../ipc.types";
+import { selectWatchedPaths } from "../../../redux/application/application.selectors";
+import FilepathItemMolecule from "../../molecules/filepath-item/filepath-item.molecule";
+const { ipcRenderer } = window;
+
+const mapStateToProps = createStructuredSelector({
+ watchedPaths: selectWatchedPaths,
+});
+const mapDispatchToProps = (dispatch) => ({
+ //setUserLanguage: language => dispatch(setUserLanguage(language))
+});
+
+export function FilePathsList({ watchedPaths }) {
+ //On Rdner, send request to get file paths to main.
+ useEffect(() => {
+ ipcRenderer.send(ipcTypes.default.fileWatcher.toMain.filepathsGet);
+ }, []);
+
+ return (
+
+ File Paths
+
+
+ );
+}
+export default connect(mapStateToProps, mapDispatchToProps)(FilePathsList);
diff --git a/src/components/organisms/sider-menu/sider-menu.organism.jsx b/src/components/organisms/sider-menu/sider-menu.organism.jsx
index 9380fc4..ddade40 100644
--- a/src/components/organisms/sider-menu/sider-menu.organism.jsx
+++ b/src/components/organisms/sider-menu/sider-menu.organism.jsx
@@ -1,36 +1,18 @@
-import {
- DesktopOutlined,
- FileOutlined,
- PieChartOutlined,
- TeamOutlined,
- UserOutlined,
-} from "@ant-design/icons";
+import { PieChartOutlined, SettingFilled } from "@ant-design/icons";
import { Menu } from "antd";
import React from "react";
import { Link } from "react-router-dom";
import SiderSignOut from "../../molecules/sider-sign-out/sider-sign-out.molecule";
-const { SubMenu } = Menu;
-
export default function SiderMenuOrganism() {
return (
);
diff --git a/src/components/organisms/watcher-manager/watcher-manager.organism.jsx b/src/components/organisms/watcher-manager/watcher-manager.organism.jsx
new file mode 100644
index 0000000..7e55813
--- /dev/null
+++ b/src/components/organisms/watcher-manager/watcher-manager.organism.jsx
@@ -0,0 +1,14 @@
+import React from "react";
+import WatcherStatusAtom from "../../atoms/watcher-status/watcher-status.atom";
+import WatcherStartMolecule from "../../molecules/watcher-start/watcher-start.molecule";
+import WatcherStopMolecule from "../../molecules/watcher-stop/watcher-stop.molecule";
+
+export default function WatcherManagerOrganism() {
+ return (
+
+
+
+
+
+ );
+}
diff --git a/src/components/pages/jobs/jobs.page.jsx b/src/components/pages/jobs/jobs.page.jsx
index 296fe4d..9215f6b 100644
--- a/src/components/pages/jobs/jobs.page.jsx
+++ b/src/components/pages/jobs/jobs.page.jsx
@@ -1,47 +1,31 @@
-import { Button } from "antd";
-import React, { useEffect } from "react";
+import React from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
-import ipcTypes from "../../../ipc.types";
-const { ipcRenderer } = window;
+//const { ipcRenderer } = window;
//const settings = window.require("electron-settings");
const mapStateToProps = createStructuredSelector({});
const mapDispatchToProps = (dispatch) => ({});
export function JobsPage() {
- useEffect(() => {
- ipcRenderer.on("test-success", (event, obj) => {
- console.log("Test Success", obj);
- });
+ // useEffect(() => {
+ // ipcRenderer.on("test-success", (event, obj) => {
+ // console.log("Test Success", obj);
+ // });
- // Cleanup the listener events so that memory leaks are avoided.
- return function cleanup() {
- ipcRenderer.removeAllListeners(
- "test-success",
- ipcTypes.default.filewatcher.startSuccess
- );
- };
- }, []);
+ // // Cleanup the listener events so that memory leaks are avoided.
+ // return function cleanup() {
+ // ipcRenderer.removeAllListeners(
+ // "test-success",
+ // ipcTypes.default.filewatcher.startSuccess
+ // );
+ // };
+ // }, []);
return (
-
Welcome to your new react app. asdas sd
-
-
+
Welcome to your new react app.
);
}
diff --git a/src/components/pages/routes/routes.page.jsx b/src/components/pages/routes/routes.page.jsx
index 62629e6..86f9183 100644
--- a/src/components/pages/routes/routes.page.jsx
+++ b/src/components/pages/routes/routes.page.jsx
@@ -5,6 +5,7 @@ import { Route, Switch } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import SiderMenuOrganism from "../../organisms/sider-menu/sider-menu.organism";
import Jobs from "../jobs/jobs.page";
+import SettingsPage from "../settings/settings.page";
const mapStateToProps = createStructuredSelector({});
const mapDispatchToProps = (dispatch) => ({});
@@ -19,6 +20,7 @@ export function RoutesPage() {
+
diff --git a/src/components/pages/settings/settings.page.jsx b/src/components/pages/settings/settings.page.jsx
new file mode 100644
index 0000000..2f2c555
--- /dev/null
+++ b/src/components/pages/settings/settings.page.jsx
@@ -0,0 +1,19 @@
+import React from "react";
+import FilePathsListOrganism from "../../organisms/filepaths-list/filepaths-list.organism";
+import WatcherManagerOrganism from "../../organisms/watcher-manager/watcher-manager.organism";
+export default function SettingsPage() {
+ return (
+
+
+
+
+ );
+}
+
+//
diff --git a/src/ipc.types.js b/src/ipc.types.js
index aba77a8..692020b 100644
--- a/src/ipc.types.js
+++ b/src/ipc.types.js
@@ -2,10 +2,25 @@ exports.default = {
test: {
start: "test-start",
},
- filewatcher: {
- start: "filewatcher__start",
- startSuccess: "filewatcher__start-success",
- startFailure: "filewatcher__start-failure",
- stop: "filewatcher__stop",
+ fileWatcher: {
+ toMain: {
+ filepathsGet: "filewatcher__filepathsget",
+ start: "filewatcher__start",
+ stop: "filewatcher__stop",
+ },
+ toRenderer: {
+ filepathsList: "filewatcher__filepathslist",
+ startSuccess: "filewatcher__start-success",
+ startFailure: "filewatcher__start-failure",
+ stopSuccess: "filewatcher__stop-success",
+ error: "filewatcher__error",
+ },
+ },
+ estimate: {
+ toRenderer: {
+ estimateDecodeStart: "estimatedecode__start",
+ estimateDecodeSuccess: "estimatedecode__success",
+ estimateDecodeFailure: "estimatedecode__failure",
+ },
},
};
diff --git a/src/ipc/ipc-init.js b/src/ipc/ipc-init.js
deleted file mode 100644
index 48b3d0d..0000000
--- a/src/ipc/ipc-init.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import ipcTypes from "../ipc.types";
-// import { store } from "../redux/store";
-// import { signOutStart } from "../redux/user/user.actions";
-const { ipcRenderer } = window;
-
-console.log("----Initializing IPC Listeners in React App.");
-
-ipcRenderer.on(ipcTypes.default.filewatcher.startSuccess, (event, ...obj) => {
- console.log(ipcTypes.default.filewatcher.startSuccess, event, obj);
-
- // store.dispatch(signOutStart());
-});
diff --git a/src/ipc/ipc-renderer-handler.js b/src/ipc/ipc-renderer-handler.js
new file mode 100644
index 0000000..4d0b4bb
--- /dev/null
+++ b/src/ipc/ipc-renderer-handler.js
@@ -0,0 +1,37 @@
+import ipcTypes from "../ipc.types";
+import {
+ setWatchedPaths,
+ setWatcherStatus,
+} from "../redux/application/application.actions";
+import { store } from "../redux/store";
+const { ipcRenderer } = window;
+
+console.log("----Initializing IPC Listeners in React App.");
+
+ipcRenderer.on(
+ ipcTypes.default.fileWatcher.toRenderer.filepathsList,
+ (event, ...obj) => {
+ store.dispatch(setWatchedPaths(obj));
+ }
+);
+
+//Filewatcher Section
+ipcRenderer.on(
+ ipcTypes.default.fileWatcher.toRenderer.startSuccess,
+ (event, ...obj) => {
+ store.dispatch(setWatcherStatus("READY!"));
+ }
+);
+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));
+ }
+);
diff --git a/src/redux/application/application.actions.js b/src/redux/application/application.actions.js
index 8c49078..e718d87 100644
--- a/src/redux/application/application.actions.js
+++ b/src/redux/application/application.actions.js
@@ -1,30 +1,25 @@
import ApplicationActionTypes from "./application.types";
-export const setRooms = (rooms) => ({
- type: ApplicationActionTypes.SET_ROOMS,
- payload: rooms,
+export const setWatchedPaths = (watchedPaths) => ({
+ type: ApplicationActionTypes.SET_WATCHED_PATHS,
+ payload: watchedPaths,
});
-export const addRoom = (room) => ({
- type: ApplicationActionTypes.ADD_ROOM,
- payload: room,
+export const addWatchedPath = (path) => ({
+ type: ApplicationActionTypes.ADD_WATCHED_PATH,
+ payload: path,
});
-export const addImages = ({ roomId, images }) => ({
- type: ApplicationActionTypes.ADD_IMAGES_TO_ROOM,
- payload: { roomId, images },
+export const removeWatchedPath = (path) => ({
+ type: ApplicationActionTypes.REMOVE_WATCHED_PATH,
+ payload: path,
});
-export const removeRoom = (roomId) => ({
- type: ApplicationActionTypes.REMOVE_ROOM,
- payload: roomId,
+export const setWatcherStatus = (status) => ({
+ type: ApplicationActionTypes.SET_WATCHER_STATUS,
+ payload: status,
});
-
-export const markNa = (roomId) => ({
- type: ApplicationActionTypes.MARK_ROOM_NA,
- payload: roomId,
-});
-export const joinRoom = (roomId) => ({
- type: ApplicationActionTypes.JOIN_ROOM,
- payload: roomId,
+export const setWatcherError = (error) => ({
+ type: ApplicationActionTypes.SET_WATCHER_ERROR,
+ payload: error,
});
diff --git a/src/redux/application/application.reducer.js b/src/redux/application/application.reducer.js
index d3713c0..fb187e3 100644
--- a/src/redux/application/application.reducer.js
+++ b/src/redux/application/application.reducer.js
@@ -1,49 +1,36 @@
import ApplicationActionTypes from "./application.types";
-import _ from "lodash";
const INITIAL_STATE = {
- rooms: [],
- images: {
- id: [],
- },
+ watcherStatus: "Not Started",
+ watchedPaths: [],
+ watcherError: null,
};
const applicationReducer = (state = INITIAL_STATE, action) => {
switch (action.type) {
- case ApplicationActionTypes.SET_ROOMS:
+ case ApplicationActionTypes.SET_WATCHED_PATHS:
return {
...state,
- rooms: _.unionBy(state.rooms, action.payload, "id"),
+ watchedPaths: action.payload,
};
- case ApplicationActionTypes.ADD_ROOM:
+ case ApplicationActionTypes.ADD_WATCHED_PATH:
return {
...state,
- rooms: _.unionBy(state.rooms, [action.payload], "id"),
+ watchedPaths: [...state.watchedPaths, action.payload],
};
- case ApplicationActionTypes.ADD_IMAGES_TO_ROOM:
+ case ApplicationActionTypes.REMOVE_WATCHED_PATH:
return {
...state,
- images: {
- ...state.images,
- [action.payload.roomId]: _.unionBy(
- state.images[action.payload.roomId] || [],
- action.payload.images,
-
- "filename"
- ),
- },
+ watchedPaths: state.watchedPaths.filter((p) => p !== action.payload),
};
- case ApplicationActionTypes.REMOVE_ROOM:
+ case ApplicationActionTypes.SET_WATCHER_STATUS:
return {
...state,
- rooms: state.rooms.filter((r) => r.id !== action.payload),
+ watcherStatus: action.payload,
};
-
- case ApplicationActionTypes.MARK_ROOM_NA:
+ case ApplicationActionTypes.SET_WATCHER_ERROR:
return {
...state,
- rooms: state.rooms.map((room) =>
- room.id === action.payload ? { ...room, na: true } : room
- ),
+ watcherError: action.payload,
};
default:
return state;
diff --git a/src/redux/application/application.sagas.js b/src/redux/application/application.sagas.js
index b2cfc40..9c961be 100644
--- a/src/redux/application/application.sagas.js
+++ b/src/redux/application/application.sagas.js
@@ -1,40 +1,13 @@
-import { all, call, takeLatest } from "redux-saga/effects";
+//import { all, call, takeLatest } from "redux-saga/effects";
import ApplicationActionTypes from "./application.types";
-export function* onJoinRoom() {
- yield takeLatest(ApplicationActionTypes.JOIN_ROOM, joinRoom);
-}
-export function* joinRoom({ payload: roomId }) {
- // console.log("function*joinRoom -> roomId", roomId);
- // //TH eactual function
- // const state = yield select();
- // const room = state.application.rooms.filter((r) => r.id === roomId)[0];
- // yield put(addImages({ roomId: null, images: [] }));
- // if (room) {
- // socket.emit(
- // "join",
- // {
- // roomName: room.name,
- // parentRoomName: room.parentName,
- // password: Math.round(Math.random() * 1000).toString(),
- // },
- // co.wrap(function* (payload) {
- // console.log("Checking Room", payload);
- // if (payload.room && payload.room.id) {
- // console.log("about to put");
- // yield put(
- // addImages({
- // roomId: payload.room.id,
- // images: payload.room.medias,
- // })
- // );
- // } else {
- // yield put(markNa(room.id));
- // }
- // })
- // );
- // }
-}
+
+// export function* onJoinRoom() {
+// yield takeLatest(ApplicationActionTypes.JOIN_ROOM, joinRoom);
+// }
+// export function* joinRoom({ payload: roomId }) {
+// // console.log("function*joinRoom -> roomId", roomId);
+// }
export function* applicationSagas() {
- yield all([call(onJoinRoom)]);
+ //yield all([call(onJoinRoom)]);
}
diff --git a/src/redux/application/application.selectors.js b/src/redux/application/application.selectors.js
index a39ee89..ce24fc7 100644
--- a/src/redux/application/application.selectors.js
+++ b/src/redux/application/application.selectors.js
@@ -2,12 +2,17 @@ import { createSelector } from "reselect";
const selectApplication = (state) => state.application;
-export const selectRooms = createSelector(
+export const selectWatcherStatus = createSelector(
[selectApplication],
- (application) => application.rooms
+ (application) => application.watcherStatus
);
-export const selectImages = createSelector(
+export const selectWatchedPaths = createSelector(
[selectApplication],
- (application) => application.images
+ (application) => application.watchedPaths
+);
+
+export const selectWatcherError = createSelector(
+ [selectApplication],
+ (application) => application.watcherError
);
diff --git a/src/redux/application/application.types.js b/src/redux/application/application.types.js
index e96aea0..847e8f5 100644
--- a/src/redux/application/application.types.js
+++ b/src/redux/application/application.types.js
@@ -1,9 +1,8 @@
const ApplicationActionTypes = {
- SET_ROOMS: "SET_ROOMS",
- ADD_ROOM: "ADD_ROOM",
- ADD_IMAGES_TO_ROOM: "ADD_IMAGES_TO_ROOM",
- REMOVE_ROOM: "REMOVE_ROOM",
- MARK_ROOM_NA: "MARK_ROOM_NA",
- JOIN_ROOM: "JOIN_ROOM",
+ SET_WATCHED_PATHS: "SET_WATCHED_PATHS",
+ ADD_WATCHED_PATH: "ADD_WATCHED_PATH",
+ REMOVE_WATCHED_PATH: "REMOVE_WATCHED_PATH",
+ SET_WATCHER_STATUS: "SET_WATCHER_STATUS",
+ SET_WATCHER_ERROR: "SET_WATCHER_ERROR",
};
export default ApplicationActionTypes;