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:
James Brunton
2025-08-14 14:27:23 +01:00
committed by GitHub
parent 0ea4410dd3
commit ecf30d1028
31 changed files with 1936 additions and 88 deletions

View File

@@ -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 });
}
}