MCPcopy Index your code
hub / github.com/github/awesome-copilot / handleHashChange

Function handleHashChange

website/src/scripts/modal.ts:769–784  ·  view source on GitHub ↗

* Handle hash changes for deep linking

()

Source from the content-addressed store, hash-verified

767 * Handle hash changes for deep linking
768 */
769function handleHashChange(): void {
770 const hash = window.location.hash;
771
772 if (hash && hash.startsWith("#file=")) {
773 const filePath = decodeURIComponent(hash.slice(6));
774 if (filePath && filePath !== currentFilePath) {
775 const type = getResourceType(filePath);
776 openFileModal(filePath, type, false); // Don't update hash since we're responding to it
777 }
778 } else if (!hash || hash === "#") {
779 // No hash or empty hash - close modal if open
780 if (currentFilePath) {
781 closeModal(false); // Don't update hash since we're responding to it
782 }
783 }
784}
785
786/**
787 * Update URL hash for deep linking

Callers 1

setupModalFunction · 0.85

Calls 3

getResourceTypeFunction · 0.90
openFileModalFunction · 0.85
closeModalFunction · 0.85

Tested by

no test coverage detected