(direction)
| 13466 | alert(`Error: ${error.message}\n\nIn server mode, all file paths must be UNC paths (e.g., \\\\server\\share\\path\\to\\file.stl)`); |
| 13467 | } |
| 13468 | } |
| 13469 | } finally { |
| 13470 | window._scanThumbnailProgress = null; |
| 13471 | // Clean up event listener |
| 13472 | stopButton.removeEventListener('click', handleStopClick); |
| 13473 | |
| 13474 | if (!background) { |
| 13475 | progressSection.classList.add('hidden'); |
| 13476 | } else { |
| 13477 | window.disableGridRefresh = false; |
| 13478 | console.log('Background scan complete: grid refresh re-enabled'); |
| 13479 | if (skipBackgroundFinallyRefresh) { |
| 13480 | console.log('Background scan: grid already refreshed after New Models dialog'); |
| 13481 | } else { |
| 13482 | // Refresh the grid so models show without requiring a page reload (docker/server mode) |
| 13483 | if (typeof window.performCombinedSearch === 'function') { |
| 13484 | window.performCombinedSearch().catch(err => console.error('Background scan post-refresh:', err)); |
| 13485 | } else { |
| 13486 | window.electron.getAllModels().then((models) => { |
| 13487 | if (typeof window.renderFiles === 'function') window.renderFiles(models); |
| 13488 | }).catch(err => console.error('Background scan post-refresh:', err)); |
| 13489 | } |
| 13490 | } |
| 13491 | } |
| 13492 | } |
| 13493 | } |
| 13494 | |
| 13495 | // Process 2: Model Display and Management |
| 13496 | async function refreshModelDisplay() { |
| 13497 | try { |
no test coverage detected