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,
|
onError: setProcessingError,
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
model.owner = newOwner;
|
model.owner = newOwner;
|
||||||
library.localUpdateItem(model);
|
library.reloadItems(() => {
|
||||||
if (callback) callback();
|
if (callback) callback();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[itemID, model, library.localUpdateItem]
|
[itemID, model, library.reloadItems]
|
||||||
);
|
);
|
||||||
|
|
||||||
const setAccessPolicy = useCallback(
|
const setAccessPolicy = useCallback(
|
||||||
|
@ -157,12 +158,13 @@ export const OssState = ({ itemID, children }: OssStateProps) => {
|
||||||
onError: setProcessingError,
|
onError: setProcessingError,
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
model.access_policy = newPolicy;
|
model.access_policy = newPolicy;
|
||||||
library.localUpdateItem(model);
|
library.reloadItems(() => {
|
||||||
if (callback) callback();
|
if (callback) callback();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[itemID, model, library.localUpdateItem]
|
[itemID, model, library.reloadItems]
|
||||||
);
|
);
|
||||||
|
|
||||||
const setLocation = useCallback(
|
const setLocation = useCallback(
|
||||||
|
@ -180,12 +182,13 @@ export const OssState = ({ itemID, children }: OssStateProps) => {
|
||||||
onError: setProcessingError,
|
onError: setProcessingError,
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
model.location = newLocation;
|
model.location = newLocation;
|
||||||
library.localUpdateItem(model);
|
library.reloadItems(() => {
|
||||||
if (callback) callback();
|
if (callback) callback();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[itemID, model, library.localUpdateItem]
|
[itemID, model, library.reloadItems]
|
||||||
);
|
);
|
||||||
|
|
||||||
const setEditors = useCallback(
|
const setEditors = useCallback(
|
||||||
|
@ -203,11 +206,13 @@ export const OssState = ({ itemID, children }: OssStateProps) => {
|
||||||
onError: setProcessingError,
|
onError: setProcessingError,
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
model.editors = newEditors;
|
model.editors = newEditors;
|
||||||
if (callback) callback();
|
library.reloadItems(() => {
|
||||||
|
if (callback) callback();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[itemID, model]
|
[itemID, model, library.reloadItems]
|
||||||
);
|
);
|
||||||
|
|
||||||
const savePositions = useCallback(
|
const savePositions = useCallback(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user