chore: [app dir bootstrapping 4] check nullability of navigation hook return values (#12005)

This commit is contained in:
Greg Pabian authored and GitHub committed 2023-10-20 16:47:05 -07:00
1 parent eac45c5e23
commit 39cfe18ffe
28 files changed
+114 -86

No files matched your search

@@ -17,7 +17,10 @@ const UsersAddView = () => {
onSuccess: async () => {
showToast("User added successfully", "success");
await utils.viewer.users.list.invalidate();
router.replace(pathname?.replace("/add", ""));
if (pathname !== null) {
router.replace(pathname.replace("/add", ""));
}
},
onError: (err) => {
console.error(err.message);