feature/IO-3066-1-scaffolding: Fix some missing PR Notes around PPG

This commit is contained in:
Dave Richer
2025-05-05 10:37:42 -04:00
parent 2953aa420e
commit cdad47b82f
7 changed files with 330 additions and 158 deletions

View File

@@ -12,7 +12,6 @@ import {
} from "../watcher/watcher";
import { PaintScaleConfig } from "../../util/types/paintScale";
// Initialize paint scale input configs in store if not set
if (!Store.get("settings.paintScaleInputConfigs")) {
Store.set("settings.paintScaleInputConfigs", []);
@@ -35,8 +34,8 @@ const SettingsWatchedFilePathsAdd = async (): Promise<string[]> => {
if (!result.canceled) {
Store.set(
"settings.filepaths",
_.union(result.filePaths, Store.get("settings.filepaths")),
"settings.filepaths",
_.union(result.filePaths, Store.get("settings.filepaths")),
);
addWatcherPath(result.filePaths);
}
@@ -45,12 +44,12 @@ const SettingsWatchedFilePathsAdd = async (): Promise<string[]> => {
};
const SettingsWatchedFilePathsRemove = async (
_event: IpcMainInvokeEvent,
path: string,
_event: IpcMainInvokeEvent,
path: string,
): Promise<string[]> => {
Store.set(
"settings.filepaths",
_.without(Store.get("settings.filepaths"), path),
"settings.filepaths",
_.without(Store.get("settings.filepaths"), path),
);
removeWatcherPath(path);
return Store.get("settings.filepaths");
@@ -65,16 +64,16 @@ const SettingsWatcherPollingGet = async (): Promise<{
interval: number;
}> => {
const pollingEnabled: { enabled: boolean; interval: number } =
Store.get("settings.polling");
Store.get("settings.polling");
return { enabled: pollingEnabled.enabled, interval: pollingEnabled.interval };
};
const SettingsWatcherPollingSet = async (
_event: IpcMainInvokeEvent,
pollingSettings: {
enabled: boolean;
interval: number;
},
_event: IpcMainInvokeEvent,
pollingSettings: {
enabled: boolean;
interval: number;
},
): Promise<{
enabled: boolean;
interval: number;
@@ -131,11 +130,13 @@ const SettingEmsOutFilePathSet = async (): Promise<string> => {
return (Store.get("settings.emsOutFilePath") as string) || "";
};
const SettingsPaintScaleInputConfigsGet = async (
_event?: IpcMainInvokeEvent,
): Promise<PaintScaleConfig[]> => {
const SettingsPaintScaleInputConfigsGet = (
_event?: IpcMainInvokeEvent,
): PaintScaleConfig[] => {
try {
const configs = Store.get("settings.paintScaleInputConfigs") as PaintScaleConfig[];
const configs = Store.get(
"settings.paintScaleInputConfigs",
) as PaintScaleConfig[];
log.debug("Retrieved paint scale input configs:", configs);
return configs || [];
} catch (error) {
@@ -145,8 +146,8 @@ const SettingsPaintScaleInputConfigsGet = async (
};
const SettingsPaintScaleInputConfigsSet = async (
_event: IpcMainInvokeEvent,
configs: PaintScaleConfig[],
_event: IpcMainInvokeEvent,
configs: PaintScaleConfig[],
): Promise<boolean> => {
try {
Store.set("settings.paintScaleInputConfigs", configs);
@@ -159,7 +160,7 @@ const SettingsPaintScaleInputConfigsSet = async (
};
const SettingsPaintScaleInputPathSet = async (
_event: IpcMainInvokeEvent,
_event: IpcMainInvokeEvent,
): Promise<string | null> => {
try {
const mainWindow = getMainWindow();
@@ -183,11 +184,13 @@ const SettingsPaintScaleInputPathSet = async (
}
};
const SettingsPaintScaleOutputConfigsGet = async (
_event?: IpcMainInvokeEvent,
): Promise<PaintScaleConfig[]> => {
const SettingsPaintScaleOutputConfigsGet = (
_event?: IpcMainInvokeEvent,
): PaintScaleConfig[] => {
try {
const configs = Store.get("settings.paintScaleOutputConfigs") as PaintScaleConfig[];
const configs = Store.get(
"settings.paintScaleOutputConfigs",
) as PaintScaleConfig[];
log.debug("Retrieved paint scale output configs:", configs);
return configs || [];
} catch (error) {
@@ -197,8 +200,8 @@ const SettingsPaintScaleOutputConfigsGet = async (
};
const SettingsPaintScaleOutputConfigsSet = async (
_event: IpcMainInvokeEvent,
configs: PaintScaleConfig[],
_event: IpcMainInvokeEvent,
configs: PaintScaleConfig[],
): Promise<boolean> => {
try {
Store.set("settings.paintScaleOutputConfigs", configs);
@@ -211,7 +214,7 @@ const SettingsPaintScaleOutputConfigsSet = async (
};
const SettingsPaintScaleOutputPathSet = async (
_event: IpcMainInvokeEvent,
_event: IpcMainInvokeEvent,
): Promise<string | null> => {
try {
const mainWindow = getMainWindow();
@@ -251,4 +254,4 @@ export {
SettingsPaintScaleOutputConfigsGet,
SettingsPaintScaleOutputConfigsSet,
SettingsPaintScaleOutputPathSet,
};
};