()
| 310 | } |
| 311 | |
| 312 | function updateViewButtons(): void { |
| 313 | const renderBtn = document.getElementById("render-btn"); |
| 314 | const rawBtn = document.getElementById("raw-btn"); |
| 315 | const markdownFile = currentFilePath |
| 316 | ? isMarkdownFile(currentFilePath) |
| 317 | : false; |
| 318 | |
| 319 | if (!renderBtn || !rawBtn) return; |
| 320 | |
| 321 | if (!markdownFile) { |
| 322 | renderBtn.classList.add("hidden"); |
| 323 | rawBtn.classList.add("hidden"); |
| 324 | return; |
| 325 | } |
| 326 | |
| 327 | if (currentViewMode === "rendered") { |
| 328 | renderBtn.classList.add("hidden"); |
| 329 | rawBtn.classList.remove("hidden"); |
| 330 | return; |
| 331 | } |
| 332 | |
| 333 | rawBtn.classList.add("hidden"); |
| 334 | renderBtn.classList.remove("hidden"); |
| 335 | } |
| 336 | |
| 337 | async function renderCurrentFileContent(): Promise<void> { |
| 338 | if (!currentFilePath) return; |
no test coverage detected