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,
|
||||
"height": 1024,
|
||||
},
|
||||
"spreadsheetLayout": map[string]interface{}{
|
||||
}
|
||||
|
||||
if ext == "xlsx" {
|
||||
payload["spreadsheetLayout"] = map[string]interface{}{
|
||||
"ignorePrintArea": true,
|
||||
"printGridlines": true,
|
||||
"printHeadings": true,
|
||||
"fitToWidth": 1,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
payloadBytes, err := json.Marshal(payload)
|
||||
|
|
|
|||
|
|
@ -375,14 +375,13 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
|||
}
|
||||
}, [currentPath, activeSection]);
|
||||
|
||||
// Refresh files after editing to catch the debounced thumbnail generation
|
||||
// Refresh files periodically after editing to catch debounced background thumbnail generation
|
||||
useEffect(() => {
|
||||
if (!editingFile && activeSection === 'files') {
|
||||
const timer = setInterval(() => {
|
||||
loadFiles(currentPath, true);
|
||||
const timer = setTimeout(() => {
|
||||
loadFiles(currentPath, true);
|
||||
}, 12000);
|
||||
return () => clearTimeout(timer);
|
||||
}, 15000);
|
||||
return () => clearInterval(timer);
|
||||
}
|
||||
}, [editingFile, activeSection, currentPath, loadFiles]);
|
||||
|
||||
|
|
|
|||
|
|
@ -123,11 +123,11 @@ export default function OfficeHome({ type, onFileSelect, onCreateBlank, onPinCha
|
|||
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(() => {
|
||||
// Refresh files periodically to catch any debounced thumbnail updates from recent edits
|
||||
const timer = setInterval(() => {
|
||||
fetchFiles();
|
||||
}, 12000);
|
||||
return () => clearTimeout(timer);
|
||||
}, 15000);
|
||||
return () => clearInterval(timer);
|
||||
}, [type]);
|
||||
|
||||
// Close context menu on click elsewhere
|
||||
|
|
|
|||
Reference in a new issue