Skip to content

Commit

Permalink
fix: Fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
criss8X committed Apr 2, 2024
1 parent 5ee925c commit 82ef5d2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/components/SidebarActions/SidebarActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import DirectMessageModal from "./DirectMessageModal"
import NotificationsModal from "./NotificationsModal"
import Modal from "../Modal"
import useNotifications from "./useNotifications"
import {useNotificationsStateStore} from "./useCachedNotifications"

const SidebarModalsHandler: FC = () => {
const {sidebarModalActive} = useSidebarModalActiveStore()
Expand Down Expand Up @@ -58,8 +59,8 @@ export type SidebarActionsProps = {
}

const SidebarActions: FC<SidebarActionsProps> = ({className}) => {
const {onLogout, setActiveSidebarModal, containsUnreadNotifications} =
useSidebarActions()
const {containsUnreadNotifications} = useNotificationsStateStore()
const {onLogout, setActiveSidebarModal} = useSidebarActions()

return (
<>
Expand Down
1 change: 1 addition & 0 deletions src/components/SidebarActions/useCachedNotifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const useCachedNotifications = () => {
})

useEffect(() => {
// Check if you have unread notifications with the `some` method and it will refresh the global status of notifications.
refreshContainsUnreadNotifications(
cachedNotifications.some(notification => !notification.isRead)
)
Expand Down
3 changes: 0 additions & 3 deletions src/components/SidebarActions/useSidebarActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {useNavigate} from "react-router-dom"
import {ViewPath} from "@/utils/util"
import {useCallback} from "react"
import {create} from "zustand"
import {useNotificationsStateStore} from "./useCachedNotifications"

export enum SidebarModals {
DirectMessages,
Expand All @@ -30,7 +29,6 @@ const useSidebarActions = () => {
const {disconnect} = useConnection()
const navigate = useNavigate()
const {setActiveSidebarModal} = useSidebarModalActiveStore()
const {containsUnreadNotifications} = useNotificationsStateStore()

const onLogout = useCallback(async () => {
await disconnect()
Expand All @@ -40,7 +38,6 @@ const useSidebarActions = () => {
return {
onLogout,
setActiveSidebarModal,
containsUnreadNotifications,
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function timeFormatter(timestamp: number): string {
}

export enum CommonAssertion {
EventIdNotFound = "eventId should not be undefined",
EventIdNotFound = "To confirm that an event happened, event id should not be undefined.",
}

export function assert(
Expand Down

0 comments on commit 82ef5d2

Please sign in to comment.