mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-08-27 06:39:24 +00:00
Remive indexxedb removal on clear files
This commit is contained in:
parent
d66b6a1fbc
commit
bb13df2b92
@ -406,7 +406,7 @@ const PageThumbnail: React.FC<PageThumbnailProps> = ({
|
||||
size="sm"
|
||||
fw={500}
|
||||
style={{
|
||||
color: 'white', // Keep white for page numbers as they have colored backgrounds
|
||||
color: 'var(--mantine-color-white)', // Use theme token for consistency
|
||||
position: 'absolute',
|
||||
top: 5,
|
||||
left: 5,
|
||||
|
@ -167,7 +167,16 @@ function FileContextInner({
|
||||
filesRef.current.clear();
|
||||
dispatch({ type: 'RESET_CONTEXT' });
|
||||
|
||||
// Clear IndexedDB if enabled
|
||||
// Don't clear IndexedDB automatically - only clear in-memory state
|
||||
// IndexedDB should only be cleared when explicitly requested by user
|
||||
},
|
||||
clearAllData: async () => {
|
||||
// First clear all files from memory
|
||||
lifecycleManager.cleanupAllFiles();
|
||||
filesRef.current.clear();
|
||||
dispatch({ type: 'RESET_CONTEXT' });
|
||||
|
||||
// Then clear IndexedDB storage
|
||||
if (indexedDB && enablePersistence) {
|
||||
try {
|
||||
await indexedDB.clearAll();
|
||||
|
@ -224,6 +224,7 @@ export interface FileContextActions {
|
||||
updateFileRecord: (id: FileId, updates: Partial<FileRecord>) => void;
|
||||
reorderFiles: (orderedFileIds: FileId[]) => void;
|
||||
clearAllFiles: () => Promise<void>;
|
||||
clearAllData: () => Promise<void>;
|
||||
|
||||
// File pinning
|
||||
pinFile: (file: File) => void;
|
||||
|
Loading…
x
Reference in New Issue
Block a user