B: Fix library cache update after changing OSS

This commit is contained in:
Ivan 2024-08-28 21:32:12 +03:00
parent cf3c9debc8
commit de0b240e78

View File

@ -134,12 +134,13 @@ export const OssState = ({ itemID, children }: OssStateProps) => {
onError: setProcessingError,
onSuccess: () => {
model.owner = newOwner;
library.localUpdateItem(model);
library.reloadItems(() => {
if (callback) callback();
});
}
});
},
[itemID, model, library.localUpdateItem]
[itemID, model, library.reloadItems]
);
const setAccessPolicy = useCallback(
@ -157,12 +158,13 @@ export const OssState = ({ itemID, children }: OssStateProps) => {
onError: setProcessingError,
onSuccess: () => {
model.access_policy = newPolicy;
library.localUpdateItem(model);
library.reloadItems(() => {
if (callback) callback();
});
}
});
},
[itemID, model, library.localUpdateItem]
[itemID, model, library.reloadItems]
);
const setLocation = useCallback(
@ -180,12 +182,13 @@ export const OssState = ({ itemID, children }: OssStateProps) => {
onError: setProcessingError,
onSuccess: () => {
model.location = newLocation;
library.localUpdateItem(model);
library.reloadItems(() => {
if (callback) callback();
});
}
});
},
[itemID, model, library.localUpdateItem]
[itemID, model, library.reloadItems]
);
const setEditors = useCallback(
@ -203,11 +206,13 @@ export const OssState = ({ itemID, children }: OssStateProps) => {
onError: setProcessingError,
onSuccess: () => {
model.editors = newEditors;
library.reloadItems(() => {
if (callback) callback();
});
}
});
},
[itemID, model]
[itemID, model, library.reloadItems]
);
const savePositions = useCallback(