B: Fix library cache update after changing OSS
This commit is contained in:
parent
800e492d89
commit
a7ad9b86f5
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue
Block a user