fix(modals): preserve model type during navigation (#771)

Move cleanupNavigationShortcuts() call before setting navigationModelType
to ensure the correct model type is preserved when using left/right arrow
keys to navigate between models. Previously, the cleanup would immediately
nullify navigationModelType, causing type-specific modal sections (like
trigger words for embeddings and usage tips for loras) to disappear.
This commit is contained in:
Will Miao
2026-01-19 09:17:05 +08:00
parent 633ad2d386
commit 4ff397e9c1

View File

@@ -940,8 +940,8 @@ function setupNavigationShortcuts(modelType) {
const modalElement = document.getElementById('modelModal');
if (!modalElement) return;
navigationModelType = modelType;
cleanupNavigationShortcuts();
navigationModelType = modelType;
navigationKeyHandler = (event) => {
if (shouldIgnoreNavigationKey(event)) return;