mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-25 03:00:23 +00:00
Stage 406: fix conflict-resolution bug — restore sessionModelState definition in _hydrateBootModelDropdown
My earlier conflict resolution between #2716 master and #2726 PR dropped the 'const sessionModelState=...' assignment that the .then() callback body uses on 6 different lines (1596, 1600, 1601, 1607, 1608, 1610). Without it boot.js would ReferenceError on every boot. Caught by tests/test_new_chat_default_model_frontend.py::test_boot_model_hydration_prefers_active_session_over_persisted_model which I'd missed in the initial touched-tests gate. Adds the assignment back at the top of the .then() callback — semantically matches the original #2716 master shape (S.session.model → wrap in {model,model_provider} object, else null).
This commit is contained in:
@@ -1587,6 +1587,9 @@ function applyBotName(){
|
||||
// options are enough for first paint; the dynamic provider list can settle
|
||||
// after the saved session is visible.
|
||||
const _hydrateBootModelDropdown=()=>populateModelDropdown({preferProfileDefaultOnFreshBoot:true}).then(()=>{
|
||||
const sessionModelState=S.session&&S.session.model
|
||||
? {model:S.session.model,model_provider:S.session.model_provider||null}
|
||||
: null;
|
||||
const savedState=(typeof _readPersistedModelState==='function')
|
||||
? _readPersistedModelState()
|
||||
: (localStorage.getItem('hermes-webui-model')?{model:localStorage.getItem('hermes-webui-model'),model_provider:null}:null);
|
||||
|
||||
Reference in New Issue
Block a user