Merge pull request #6784 from continuedev/tomasz/con-2917-models-not-showing-up-always-says-loading-config
fix: use loading state for loading indicator, better error messages
This commit is contained in:
commit
70302e2f2b
3 changed files with 5 additions and 5 deletions
|
|
@ -438,7 +438,7 @@ export class ConfigHandler {
|
|||
if (!this.currentProfile) {
|
||||
return {
|
||||
config: undefined,
|
||||
errors: [],
|
||||
errors: [{ message: "Current profile not found", fatal: true }],
|
||||
configLoadInterrupted: true,
|
||||
};
|
||||
}
|
||||
|
|
@ -494,7 +494,7 @@ export class ConfigHandler {
|
|||
if (!this.currentProfile) {
|
||||
return {
|
||||
config: undefined,
|
||||
errors: [],
|
||||
errors: [{ message: "Current profile not found", fatal: true }],
|
||||
configLoadInterrupted: true,
|
||||
};
|
||||
}
|
||||
|
|
@ -507,7 +507,7 @@ export class ConfigHandler {
|
|||
if (!this.currentProfile) {
|
||||
return {
|
||||
config: undefined,
|
||||
errors: [],
|
||||
errors: [{ message: "Current profile not found", fatal: true }],
|
||||
configLoadInterrupted: true,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import { useAuth } from "../../context/Auth";
|
|||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { AddModelForm } from "../../forms/AddModelForm";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
import { EMPTY_CONFIG } from "../../redux/slices/configSlice";
|
||||
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
|
||||
import { updateSelectedModelByRole } from "../../redux/thunks/updateSelectedModelByRole";
|
||||
import {
|
||||
|
|
@ -94,6 +93,7 @@ function ModelSelect() {
|
|||
|
||||
const isInEdit = useAppSelector((store) => store.session.isInEdit);
|
||||
const config = useAppSelector((state) => state.config.config);
|
||||
const isConfigLoading = useAppSelector((state) => state.config.loading);
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const buttonRef = useRef<HTMLButtonElement>(null);
|
||||
const [options, setOptions] = useState<Option[]>([]);
|
||||
|
|
@ -192,7 +192,6 @@ function ModelSelect() {
|
|||
);
|
||||
}
|
||||
|
||||
const isConfigLoading = config === EMPTY_CONFIG;
|
||||
const hasNoModels = allModels?.length === 0;
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ export const configSlice = createSlice({
|
|||
} else {
|
||||
state.config = config;
|
||||
}
|
||||
state.loading = false;
|
||||
},
|
||||
updateConfig: (
|
||||
state,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue