get dynamic prompts working

This commit is contained in:
Mary Hipp 2024-08-08 15:07:23 -04:00
parent 3f9a674d4b
commit 3189ab6863

View File

@ -13,13 +13,16 @@ import {
import { getShouldProcessPrompt } from 'features/dynamicPrompts/util/getShouldProcessPrompt'; import { getShouldProcessPrompt } from 'features/dynamicPrompts/util/getShouldProcessPrompt';
import { utilitiesApi } from 'services/api/endpoints/utilities'; import { utilitiesApi } from 'services/api/endpoints/utilities';
import { socketConnected } from 'services/events/actions'; import { socketConnected } from 'services/events/actions';
import { getPresetModifiedPrompts } from '../../../../../features/nodes/util/graph/graphBuilderUtils';
import { activeStylePresetChanged } from '../../../../../features/stylePresets/store/stylePresetSlice';
const matcher = isAnyOf( const matcher = isAnyOf(
positivePromptChanged, positivePromptChanged,
combinatorialToggled, combinatorialToggled,
maxPromptsChanged, maxPromptsChanged,
maxPromptsReset, maxPromptsReset,
socketConnected socketConnected,
activeStylePresetChanged
); );
export const addDynamicPromptsListener = (startAppListening: AppStartListening) => { export const addDynamicPromptsListener = (startAppListening: AppStartListening) => {
@ -28,7 +31,7 @@ export const addDynamicPromptsListener = (startAppListening: AppStartListening)
effect: async (action, { dispatch, getState, cancelActiveListeners, delay }) => { effect: async (action, { dispatch, getState, cancelActiveListeners, delay }) => {
cancelActiveListeners(); cancelActiveListeners();
const state = getState(); const state = getState();
const { positivePrompt } = state.controlLayers.present; const { positivePrompt } = getPresetModifiedPrompts(state)
const { maxPrompts } = state.dynamicPrompts; const { maxPrompts } = state.dynamicPrompts;
if (state.config.disabledFeatures.includes('dynamicPrompting')) { if (state.config.disabledFeatures.includes('dynamicPrompting')) {