Add watcher status and additional typing.
This commit is contained in:
@@ -2,6 +2,7 @@ import { BrowserWindow, dialog, IpcMainInvokeEvent } from "electron";
|
||||
import log from "electron-log/main";
|
||||
import _ from "lodash";
|
||||
import Store from "../store/store";
|
||||
import { addWatcherPath, removeWatcherPath, watcher } from "../watcher/watcher";
|
||||
|
||||
const SettingsWatchedFilePathsAdd = async (): Promise<string[]> => {
|
||||
const mainWindow = BrowserWindow.getAllWindows()[0]; //TODO: Filter to only main window once a proper key has been set.
|
||||
@@ -18,6 +19,7 @@ const SettingsWatchedFilePathsAdd = async (): Promise<string[]> => {
|
||||
"settings.filepaths",
|
||||
_.union(result.filePaths, Store.get("settings.filepaths"))
|
||||
);
|
||||
addWatcherPath(result.filePaths);
|
||||
}
|
||||
|
||||
return Store.get("settings.filepaths");
|
||||
@@ -30,7 +32,7 @@ const SettingsWatchedFilePathsRemove = async (
|
||||
"settings.filepaths",
|
||||
_.without(Store.get("settings.filepaths"), path)
|
||||
);
|
||||
|
||||
removeWatcherPath(path);
|
||||
return Store.get("settings.filepaths");
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user