MCPcopy Create free account
hub / github.com/jackvale/rectg / initRouting

Function initRouting

web/src/scripts/main.js:583–597  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

581}
582
583function initRouting() {
584 const params = new URLSearchParams(window.location.search);
585 const cat = params.get('c');
586 const query = params.get('q');
587
588 if (cat && !query) {
589 window.location.replace(categoryPath(cat));
590 return;
591 }
592
593 if (query && searchInput) {
594 searchInput.value = query;
595 renderSearch(query, { updateUrl: false });
596 }
597}
598
599function init() {
600 collectDomRefs();

Callers

nothing calls this directly

Calls 2

renderSearchFunction · 0.85
categoryPathFunction · 0.70

Tested by

no test coverage detected