Reformat.
This commit is contained in:
@@ -27,7 +27,7 @@ const logIpcMessages = (): void => {
|
||||
`%c[IPC Main]%c${messageType}`,
|
||||
"color: red",
|
||||
"color: green",
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
// Call original handler if it existed
|
||||
if (originalHandler) {
|
||||
@@ -38,7 +38,7 @@ const logIpcMessages = (): void => {
|
||||
};
|
||||
|
||||
ipcMain.on(ipcTypes.toMain.test, () =>
|
||||
console.log("** Verify that ipcMain is loaded and working.")
|
||||
console.log("** Verify that ipcMain is loaded and working."),
|
||||
);
|
||||
|
||||
//Auth handler
|
||||
@@ -67,15 +67,15 @@ if (import.meta.env.DEV) {
|
||||
//Settings Handlers
|
||||
ipcMain.handle(
|
||||
ipcTypes.toMain.settings.filepaths.get,
|
||||
SettingsWatchedFilePathsGet
|
||||
SettingsWatchedFilePathsGet,
|
||||
);
|
||||
ipcMain.handle(
|
||||
ipcTypes.toMain.settings.filepaths.add,
|
||||
SettingsWatchedFilePathsAdd
|
||||
SettingsWatchedFilePathsAdd,
|
||||
);
|
||||
ipcMain.handle(
|
||||
ipcTypes.toMain.settings.filepaths.remove,
|
||||
SettingsWatchedFilePathsRemove
|
||||
SettingsWatchedFilePathsRemove,
|
||||
);
|
||||
|
||||
//Watcher Handlers
|
||||
|
||||
@@ -17,7 +17,7 @@ const SettingsWatchedFilePathsAdd = async (): Promise<string[]> => {
|
||||
if (!result.canceled) {
|
||||
Store.set(
|
||||
"settings.filepaths",
|
||||
_.union(result.filePaths, Store.get("settings.filepaths"))
|
||||
_.union(result.filePaths, Store.get("settings.filepaths")),
|
||||
);
|
||||
addWatcherPath(result.filePaths);
|
||||
}
|
||||
@@ -26,11 +26,11 @@ const SettingsWatchedFilePathsAdd = async (): Promise<string[]> => {
|
||||
};
|
||||
const SettingsWatchedFilePathsRemove = async (
|
||||
event: IpcMainInvokeEvent,
|
||||
path: string
|
||||
path: string,
|
||||
): Promise<string[]> => {
|
||||
Store.set(
|
||||
"settings.filepaths",
|
||||
_.without(Store.get("settings.filepaths"), path)
|
||||
_.without(Store.get("settings.filepaths"), path),
|
||||
);
|
||||
removeWatcherPath(path);
|
||||
return Store.get("settings.filepaths");
|
||||
|
||||
@@ -12,14 +12,14 @@ import log from "electron-log/main";
|
||||
|
||||
const ipcMainHandleAuthStateChanged = async (
|
||||
event: IpcMainEvent,
|
||||
user: User | null
|
||||
user: User | null,
|
||||
): Promise<void> => {
|
||||
Store.set("user", user);
|
||||
|
||||
//Need to query the currently active shop, and store the metadata as well.
|
||||
//Also need to query the OP Codes for decoding reference.
|
||||
const activeBodyshop: ActiveBodyshopQueryResult = await client.request(
|
||||
QUERY_ACTIVE_BODYSHOP_TYPED
|
||||
QUERY_ACTIVE_BODYSHOP_TYPED,
|
||||
);
|
||||
|
||||
Store.set("app.bodyshop", activeBodyshop.bodyshops[0]);
|
||||
@@ -28,7 +28,7 @@ const ipcMainHandleAuthStateChanged = async (
|
||||
QUERY_MASTERDATA_TYPED,
|
||||
{
|
||||
key: `${activeBodyshop.bodyshops[0].region_config}_ciecaopcodes`,
|
||||
}
|
||||
},
|
||||
);
|
||||
Store.set("app.masterdata.opcodes", JSON.parse(OpCodes.masterdata[0]?.value));
|
||||
log.debug("Received authentication state change from Renderer.", user);
|
||||
|
||||
Reference in New Issue
Block a user