Fixes: Progress bar does not activate when changing model

This commit is contained in:
psychedelicious 2022-10-31 18:57:41 +11:00
parent c19b02ab21
commit 7b329b7c91
2 changed files with 9 additions and 3 deletions

View File

@ -14,6 +14,7 @@ import { OptionsState } from '../../features/options/optionsSlice';
import {
addLogEntry,
errorOccurred,
modelChangeRequested,
setCurrentStatus,
setIsCancelable,
setIsProcessing,
@ -191,9 +192,7 @@ const makeSocketIOEmitters = (
socketio.emit('requestSystemConfig');
},
emitRequestModelChange: (modelName: string) => {
dispatch(setCurrentStatus('Changing Model'));
dispatch(setIsProcessing(true));
dispatch(setIsCancelable(false));
dispatch(modelChangeRequested());
socketio.emit('requestModelChange', modelName);
},
};

View File

@ -172,6 +172,12 @@ export const systemSlice = createSlice({
setIsCancelable: (state, action: PayloadAction<boolean>) => {
state.isCancelable = action.payload;
},
modelChangeRequested: (state) => {
state.currentStatus = 'Loading Model';
state.isCancelable = false;
state.isProcessing = true;
state.currentStatusHasSteps = false;
},
},
});
@ -193,6 +199,7 @@ export const {
errorSeen,
setModelList,
setIsCancelable,
modelChangeRequested,
} = systemSlice.actions;
export default systemSlice.reducer;