Skip to content

Commit

Permalink
fix: default model
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogtiti committed Sep 27, 2024
1 parent 870ad91 commit c6ebd6e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/store/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,13 @@ export const useAccessStore = createPersistStore(
})
.then((res) => res.json())
.then((res) => {
// Set default model from env request
let defaultModel = res.defaultModel ?? "";
if (defaultModel !== "")
DEFAULT_CONFIG.modelConfig.model = defaultModel;
const defaultModel = res.defaultModel ?? "";
if (defaultModel !== "") {
const [model, providerName] = defaultModel.split("@");
DEFAULT_CONFIG.modelConfig.model = model;
DEFAULT_CONFIG.modelConfig.providerName = providerName;
}

return res;
})
.then((res: DangerConfig) => {
Expand Down

0 comments on commit c6ebd6e

Please sign in to comment.