fix(console): guard against missing window.__rankVocab
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
911bbf9103
commit
2060af44f2
1 changed files with 4 additions and 0 deletions
|
|
@ -107,6 +107,10 @@ function bindConsoleAutocomplete(form) {
|
||||||
|
|
||||||
function recompute() {
|
function recompute() {
|
||||||
if (!vocab) return;
|
if (!vocab) return;
|
||||||
|
if (typeof window.__rankVocab !== "function") {
|
||||||
|
console.warn("[console-autocomplete] window.__rankVocab unavailable — vocab-rank.bundle.js failed to load?");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const slice = firstTokenSlice(input.value, input.selectionStart || 0);
|
const slice = firstTokenSlice(input.value, input.selectionStart || 0);
|
||||||
if (!slice || !slice.token) { close(); return; }
|
if (!slice || !slice.token) { close(); return; }
|
||||||
items = window.__rankVocab(slice.token, vocab);
|
items = window.__rankVocab(slice.token, vocab);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue