mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-02-17 13:52:14 +01:00
Implement 'Add Password' and 'Change Permissions' tools in V2 (#4195)
# Description of Changes Implement Add Password and Change Permissions tools in V2 (both in one because Change Permissions is a fake endpoint which just calls Add Password behind the scenes). --------- Co-authored-by: James <james@crosscourtanalytics.com>
This commit is contained in:
@@ -460,9 +460,7 @@ export function FileContextProvider({
|
||||
thumbnailGenerationService.destroy();
|
||||
|
||||
// Force garbage collection hint
|
||||
if (typeof window !== 'undefined') {
|
||||
setTimeout(() => window.gc && window.gc(), 100);
|
||||
}
|
||||
setTimeout(() => window?.gc?.(), 100);
|
||||
|
||||
} catch (error) {
|
||||
console.warn('Error during cleanup all files:', error);
|
||||
@@ -596,9 +594,9 @@ export function FileContextProvider({
|
||||
dispatch({ type: 'SET_CURRENT_MODE', payload: mode });
|
||||
|
||||
if (state.currentMode !== mode && state.activeFiles.length > 0) {
|
||||
if (window.requestIdleCallback && typeof window !== 'undefined') {
|
||||
if (window.requestIdleCallback) {
|
||||
window.requestIdleCallback(() => {
|
||||
window.gc && window.gc();
|
||||
window.gc?.();
|
||||
}, { timeout: 5000 });
|
||||
}
|
||||
}
|
||||
@@ -610,9 +608,9 @@ export function FileContextProvider({
|
||||
dispatch({ type: 'SET_CURRENT_VIEW', payload: view });
|
||||
|
||||
if (state.currentView !== view && state.activeFiles.length > 0) {
|
||||
if (window.requestIdleCallback && typeof window !== 'undefined') {
|
||||
if (window.requestIdleCallback) {
|
||||
window.requestIdleCallback(() => {
|
||||
window.gc && window.gc();
|
||||
window.gc?.();
|
||||
}, { timeout: 5000 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user