Fix: thumbnail worker payload for non-xlsx files and change timeout to interval for thumbnail updates
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m27s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m27s
This commit is contained in:
parent
d8526afd45
commit
d4e66c9afa
3 changed files with 13 additions and 11 deletions
|
|
@ -167,12 +167,15 @@ func generateOfficeThumbnail(filePath, destPath string, cfg *config.Config) erro
|
||||||
"width": 1024,
|
"width": 1024,
|
||||||
"height": 1024,
|
"height": 1024,
|
||||||
},
|
},
|
||||||
"spreadsheetLayout": map[string]interface{}{
|
}
|
||||||
|
|
||||||
|
if ext == "xlsx" {
|
||||||
|
payload["spreadsheetLayout"] = map[string]interface{}{
|
||||||
"ignorePrintArea": true,
|
"ignorePrintArea": true,
|
||||||
"printGridlines": true,
|
"printGridlines": true,
|
||||||
"printHeadings": true,
|
"printHeadings": true,
|
||||||
"fitToWidth": 1,
|
"fitToWidth": 1,
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
payloadBytes, err := json.Marshal(payload)
|
payloadBytes, err := json.Marshal(payload)
|
||||||
|
|
|
||||||
|
|
@ -375,14 +375,13 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
||||||
}
|
}
|
||||||
}, [currentPath, activeSection]);
|
}, [currentPath, activeSection]);
|
||||||
|
|
||||||
// Refresh files after editing to catch the debounced thumbnail generation
|
// Refresh files periodically after editing to catch debounced background thumbnail generation
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!editingFile && activeSection === 'files') {
|
if (!editingFile && activeSection === 'files') {
|
||||||
|
const timer = setInterval(() => {
|
||||||
loadFiles(currentPath, true);
|
loadFiles(currentPath, true);
|
||||||
const timer = setTimeout(() => {
|
}, 15000);
|
||||||
loadFiles(currentPath, true);
|
return () => clearInterval(timer);
|
||||||
}, 12000);
|
|
||||||
return () => clearTimeout(timer);
|
|
||||||
}
|
}
|
||||||
}, [editingFile, activeSection, currentPath, loadFiles]);
|
}, [editingFile, activeSection, currentPath, loadFiles]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,11 +123,11 @@ export default function OfficeHome({ type, onFileSelect, onCreateBlank, onPinCha
|
||||||
fetchFiles();
|
fetchFiles();
|
||||||
api.createDownloadToken().then(setDownloadToken).catch(console.error);
|
api.createDownloadToken().then(setDownloadToken).catch(console.error);
|
||||||
|
|
||||||
// Refresh files after 12 seconds to catch any debounced thumbnail updates from recent edits
|
// Refresh files periodically to catch any debounced thumbnail updates from recent edits
|
||||||
const timer = setTimeout(() => {
|
const timer = setInterval(() => {
|
||||||
fetchFiles();
|
fetchFiles();
|
||||||
}, 12000);
|
}, 15000);
|
||||||
return () => clearTimeout(timer);
|
return () => clearInterval(timer);
|
||||||
}, [type]);
|
}, [type]);
|
||||||
|
|
||||||
// Close context menu on click elsewhere
|
// Close context menu on click elsewhere
|
||||||
|
|
|
||||||
Reference in a new issue