File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
invokeai/frontend/web/src/features/controlLayers/store Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type { RootState } from 'app/store/store';
44import type { SliceConfig } from 'app/store/types' ;
55import { deepClone } from 'common/util/deepClone' ;
66import { roundDownToMultiple , roundToMultiple } from 'common/util/roundDownToMultiple' ;
7- import { isPlainObject , uniq } from 'es-toolkit' ;
7+ import { isPlainObject } from 'es-toolkit' ;
88import { clamp } from 'es-toolkit/compat' ;
99import type { AspectRatioID , ParamsState , RgbaColor } from 'features/controlLayers/store/types' ;
1010import {
@@ -198,10 +198,11 @@ const slice = createSlice({
198198 if ( prompt . length === 0 ) {
199199 return ;
200200 }
201- // Remove if already exists
202- state . positivePromptHistory = uniq ( state . positivePromptHistory ) ;
203201
204- // Add to front
202+ if ( state . positivePromptHistory . includes ( prompt ) ) {
203+ return ;
204+ }
205+
205206 state . positivePromptHistory . unshift ( prompt ) ;
206207
207208 if ( state . positivePromptHistory . length > MAX_POSITIVE_PROMPT_HISTORY ) {
You can’t perform that action at this time.
0 commit comments