use Redux for tulajdonsagok

This commit is contained in:
2024-03-31 11:55:56 +02:00
parent edbe8934e4
commit a922b006bc
12 changed files with 212 additions and 71 deletions
+6 -2
View File
@@ -27,8 +27,12 @@ function Router(props: {faro?: Faro}) {
console.log(response)
})
.then(userNameResponse => {
const userName = userNameResponse && userNameResponse.length > 0 ? userNameResponse : null;
dispatch(setUser(userName))
if (userNameResponse && userNameResponse.length > 0) {
dispatch(setUser(userNameResponse))
} else {
dispatch(unsetUser())
}
})
.catch(() => {
dispatch(unsetUser())