mirror of
https://github.com/datascale-ai/opentalking.git
synced 2026-07-07 01:45:57 +08:00
fix: Remove the mutual exclusivity between "persona selection" and "driving model selection."
This commit is contained in:
@@ -2739,12 +2739,6 @@ export default function App() {
|
||||
|
||||
const handleModelChange = useCallback((newModel: string) => {
|
||||
clearSubtitleState();
|
||||
setSelectedPersonaId("");
|
||||
try {
|
||||
window.localStorage.removeItem(SELECTED_PERSONA_STORAGE_KEY);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
setModel(newModel);
|
||||
void (async () => {
|
||||
const sid = sessionIdRef.current;
|
||||
|
||||
@@ -15,3 +15,15 @@ def test_frontend_prefers_backend_default_model_before_avatar_model() -> None:
|
||||
assert default_idx < avatar_idx
|
||||
|
||||
assert "mo.default_model" in source
|
||||
|
||||
|
||||
|
||||
def test_frontend_keeps_persona_selected_when_model_changes() -> None:
|
||||
source = Path("apps/web/src/App.tsx").read_text(encoding="utf-8")
|
||||
start = source.index(" const handleModelChange = useCallback((newModel: string) => {")
|
||||
end = source.index(" }, [clearSubtitleState, releaseSession, resetLiveState]);", start)
|
||||
block = source[start:end]
|
||||
assert 'setSelectedPersonaId("")' not in block
|
||||
assert 'window.localStorage.removeItem(SELECTED_PERSONA_STORAGE_KEY)' not in block
|
||||
assert 'clearSubtitleState();' in block
|
||||
assert 'setModel(newModel);' in block
|
||||
|
||||
Reference in New Issue
Block a user