Fix: thumbnail border styles and auto-refresh logic
All checks were successful
Automated Container Build / build-and-push (push) Successful in 41s

This commit is contained in:
Elijah 2026-05-25 15:04:11 -07:00
parent a87bb351d0
commit d8526afd45
3 changed files with 20 additions and 3 deletions

View file

@ -375,6 +375,17 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
}
}, [currentPath, activeSection]);
// Refresh files after editing to catch the debounced thumbnail generation
useEffect(() => {
if (!editingFile && activeSection === 'files') {
loadFiles(currentPath, true);
const timer = setTimeout(() => {
loadFiles(currentPath, true);
}, 12000);
return () => clearTimeout(timer);
}
}, [editingFile, activeSection, currentPath, loadFiles]);
const loadFolderTree = useCallback(async () => {
try {
const data = await api.getFolderTree();

View file

@ -122,6 +122,12 @@ export default function OfficeHome({ type, onFileSelect, onCreateBlank, onPinCha
useEffect(() => {
fetchFiles();
api.createDownloadToken().then(setDownloadToken).catch(console.error);
// Refresh files after 12 seconds to catch any debounced thumbnail updates from recent edits
const timer = setTimeout(() => {
fetchFiles();
}, 12000);
return () => clearTimeout(timer);
}, [type]);
// Close context menu on click elsewhere

View file

@ -18,10 +18,10 @@ export default function ThumbnailImage({ checksum, fallbackIcon, downloadToken }
key={key}
src={downloadToken ? `${api.getThumbnailUrl(checksum, downloadToken)}${errorCount > 0 ? `&t=${key}` : ''}` : ''}
alt=""
className="w-full h-full object-contain"
style={{ display: showFallback ? 'none' : 'block' }}
className="w-full h-full object-contain bg-white border border-black/10 dark:border-white/10 shadow-sm rounded-sm"
style={{ display: showFallback ? 'none' : 'block', padding: '2px' }}
onError={(e) => {
if (errorCount < 5) {
if (errorCount < 20) {
e.currentTarget.style.display = 'none';
setTimeout(() => {
setErrorCount(c => c + 1);