fix: sync the correct collection with edit action (#3166)

* fix: sync the correct collection with edit action

* fix: remove action suggestions on undefined

* Update app/hooks/useCommandBarActions.ts

Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
Saumya Pandey
2022-02-26 10:09:03 +05:30
committed by GitHub
parent ccacb65d9e
commit ad2bce9c10
3 changed files with 10 additions and 3 deletions

View File

@@ -11,7 +11,10 @@ import useActionContext from "./useActionContext";
*
* @param actions actions to make available
*/
export default function useCommandBarActions(actions: Action[]) {
export default function useCommandBarActions(
actions: Action[],
additionalDeps: React.DependencyList = []
) {
const location = useLocation();
const context = useActionContext({
isCommandBar: true,
@@ -24,5 +27,6 @@ export default function useCommandBarActions(actions: Action[]) {
useRegisterActions(registerable, [
registerable.map((r) => r.id).join(""),
location.pathname,
...additionalDeps,
]);
}