Skip to content

Commit 5610427

Browse files
committed
fix an issue where the selected model might be not displayed correctly due to inconsistent key ordering in JSON.stringify
1 parent d9acdda commit 5610427

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/model-name-convert.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ export function getApiModesStringArrayFromConfig(config, onlyActive) {
121121

122122
export function isApiModeSelected(apiMode, configOrSession) {
123123
return configOrSession.apiMode
124-
? JSON.stringify(configOrSession.apiMode) === JSON.stringify(apiMode)
124+
? JSON.stringify(configOrSession.apiMode, Object.keys(configOrSession.apiMode).sort()) ===
125+
JSON.stringify(apiMode, Object.keys(apiMode).sort())
125126
: configOrSession.modelName === apiModeToModelName(apiMode)
126127
}
127128

0 commit comments

Comments
 (0)