feat: Reset clipSkip when advanced options is turned off

This commit is contained in:
blessedcoolant 2023-07-07 16:21:16 +12:00
parent 1ac787f3c1
commit c6d6b33e3c

View File

@ -2,6 +2,7 @@ import type { PayloadAction } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import { DEFAULT_SCHEDULER_NAME } from 'app/constants';
import { configChanged } from 'features/system/store/configSlice';
import { setShouldShowAdvancedOptions } from 'features/ui/store/uiSlice';
import { clamp } from 'lodash-es';
import { ImageDTO } from 'services/api/types';
import {
@ -230,6 +231,10 @@ export const generationSlice = createSlice({
state.model = defaultModel;
}
});
builder.addCase(setShouldShowAdvancedOptions, (state, action) => {
const advancedOptionsStatus = action.payload;
if (!advancedOptionsStatus) state.clipSkip = 0;
});
},
});