Skip to content

Commit

Permalink
console: Fix navigate after archive on small screen
Browse files Browse the repository at this point in the history
  • Loading branch information
ryaplots committed Feb 1, 2024
1 parent b7b909f commit f1f1f3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pkg/webui/console/containers/notifications/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,18 @@ const Notifications = React.memo(() => {
index + BATCH_SIZE > items.length - 1 ? items.length - 1 : index + BATCH_SIZE,
)

navigate(`/notifications/${category}/${previousNotification.id}`)
if (isSmallScreen) {
navigate(`/notifications/${category}`)
} else {
navigate(`/notifications/${category}/${previousNotification.id}`)
}

// Reset the list cache if available so that old items are discarded.
if (listRef.current && listRef.current.resetloadMoreItemsCache) {
listRef.current.resetloadMoreItemsCache()
}
},
[showArchived, dispatch, items, totalCount, navigate, category, loadNextPage],
[showArchived, dispatch, items, totalCount, navigate, category, loadNextPage, isSmallScreen],
)

// Add a resize handler to detect mobile experiences.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const NotificationContent = ({ onArchive, selectedNotification }) => {
<Button.Link
to="/notifications/inbox"
icon="chevron_left"
className="m:d-flex d-none"
className="s:d-flex d-none"
naked
/>
<div>
Expand Down

0 comments on commit f1f1f3b

Please sign in to comment.