initiate TI model query when socket connects so user doesnt have to wait when opening prompt trigger phrases

This commit is contained in:
Mary Hipp 2024-03-13 13:19:19 -04:00 committed by psychedelicious
parent 1d2743af1b
commit cd55c23713

View File

@ -4,6 +4,7 @@ import { $baseUrl } from 'app/store/nanostores/baseUrl';
import { isEqual } from 'lodash-es';
import { atom } from 'nanostores';
import { api } from 'services/api';
import { modelsApi } from 'services/api/endpoints/models';
import { queueApi, selectQueueStatus } from 'services/api/endpoints/queue';
import { socketConnected } from 'services/events/actions';
@ -17,6 +18,9 @@ export const addSocketConnectedEventListener = (startAppListening: AppStartListe
effect: async (action, { dispatch, getState, cancelActiveListeners, delay }) => {
log.debug('Connected');
// query TIs so they are ready if user opens trigger phrases
dispatch(modelsApi.endpoints.getTextualInversionModels.initiate());
/**
* The rest of this listener has recovery logic for when the socket disconnects and reconnects.
*