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';
4
4
import type { SliceConfig } from 'app/store/types' ;
5
5
import { deepClone } from 'common/util/deepClone' ;
6
6
import { roundDownToMultiple , roundToMultiple } from 'common/util/roundDownToMultiple' ;
7
- import { isPlainObject , uniq } from 'es-toolkit' ;
7
+ import { isPlainObject } from 'es-toolkit' ;
8
8
import { clamp } from 'es-toolkit/compat' ;
9
9
import type { AspectRatioID , ParamsState , RgbaColor } from 'features/controlLayers/store/types' ;
10
10
import {
@@ -198,10 +198,11 @@ const slice = createSlice({
198
198
if ( prompt . length === 0 ) {
199
199
return ;
200
200
}
201
- // Remove if already exists
202
- state . positivePromptHistory = uniq ( state . positivePromptHistory ) ;
203
201
204
- // Add to front
202
+ if ( state . positivePromptHistory . includes ( prompt ) ) {
203
+ return ;
204
+ }
205
+
205
206
state . positivePromptHistory . unshift ( prompt ) ;
206
207
207
208
if ( state . positivePromptHistory . length > MAX_POSITIVE_PROMPT_HISTORY ) {
You can’t perform that action at this time.
0 commit comments