* Handle hash changes for deep linking
()
| 767 | * Handle hash changes for deep linking |
| 768 | */ |
| 769 | function 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 |
no test coverage detected