From 8d43cf92f6fdadbeede26aa66845d4f1ce1a1904 Mon Sep 17 00:00:00 2001
From: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
Date: Mon, 26 Jun 2023 12:00:38 +1000
Subject: [PATCH] feat(ui): update action santizer for schema actions
---
.../middleware/devtools/actionSanitizer.ts | 28 +++++++++++--------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/invokeai/frontend/web/src/app/store/middleware/devtools/actionSanitizer.ts b/invokeai/frontend/web/src/app/store/middleware/devtools/actionSanitizer.ts
index 227b15d6f8..143b16594c 100644
--- a/invokeai/frontend/web/src/app/store/middleware/devtools/actionSanitizer.ts
+++ b/invokeai/frontend/web/src/app/store/middleware/devtools/actionSanitizer.ts
@@ -1,6 +1,7 @@
import { AnyAction } from '@reduxjs/toolkit';
import { isAnyGraphBuilt } from 'features/nodes/store/actions';
-import { forEach } from 'lodash-es';
+import { nodeTemplatesBuilt } from 'features/nodes/store/nodesSlice';
+import { receivedOpenAPISchema } from 'services/api/thunks/schema';
import { Graph } from 'services/api/types';
export const actionSanitizer = (action: A): A => {
@@ -8,17 +9,6 @@ export const actionSanitizer = (action: A): A => {
if (action.payload.nodes) {
const sanitizedNodes: Graph['nodes'] = {};
- // Sanitize nodes as needed
- forEach(action.payload.nodes, (node, key) => {
- // Don't log the whole freaking dataURL
- if (node.type === 'dataURL_image') {
- const { dataURL, ...rest } = node;
- sanitizedNodes[key] = { ...rest, dataURL: '' };
- } else {
- sanitizedNodes[key] = { ...node };
- }
- });
-
return {
...action,
payload: { ...action.payload, nodes: sanitizedNodes },
@@ -26,5 +16,19 @@ export const actionSanitizer = (action: A): A => {
}
}
+ if (receivedOpenAPISchema.fulfilled.match(action)) {
+ return {
+ ...action,
+ payload: '',
+ };
+ }
+
+ if (nodeTemplatesBuilt.match(action)) {
+ return {
+ ...action,
+ payload: '',
+ };
+ }
+
return action;
};