Skip to content

Commit

Permalink
Fixed not logged in (#2850)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheshiriks authored Nov 8, 2023
1 parent 02a727b commit 260cf80
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ val indexViewInfo: FC<UserInfoAwareProps> = FC { props ->
val (notificationForDeletion, setNotificationForDeletion) = useState<NotificationDto?>(null)

useRequest {
val newNotifications = get(
url = "$apiUrl/notifications/get-all-by-user",
headers = jsonHeaders,
loadingHandler = ::noopLoadingHandler,
).unsafeMap {
it.decodeFromJsonString<List<NotificationDto>>()
}
props.userInfo?.let {
val newNotifications = get(
url = "$apiUrl/notifications/get-all-by-user",
headers = jsonHeaders,
loadingHandler = ::noopLoadingHandler,
).unsafeMap {
it.decodeFromJsonString<List<NotificationDto>>()
}

setNotifications(newNotifications)
setNotifications(newNotifications)
}
}

useRequest(arrayOf(notificationForDeletion)) {
Expand Down

0 comments on commit 260cf80

Please sign in to comment.