Skip to content

Commit

Permalink
fix: remove activity updated subscription as it is not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsinht committed Jul 24, 2023
1 parent e565e31 commit b359512
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/hooks/activityNavigation/ActivityProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const ActivityProvider: FC<ActivityProviderProps> = ({
const [currentActivityId, setCurrentActivityId] = useState<string>('')

const findCurrentActivity = (): Activity | undefined => {
if (activities.length === 0) {
if (activities.length === 0 || currentActivityId === '') {
return undefined
}
return activities.find(({ id }) => id === currentActivityId)
Expand Down
2 changes: 0 additions & 2 deletions src/hooks/useSessionActivities/useSessionActivities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { updateQuery } from '../../services/graphql'
import {
Activity,
useOnSessionActivityCompletedSubscription,
useOnSessionActivityUpdatedSubscription,
useOnSessionActivityCreatedSubscription,
useGetHostedSessionActivitiesQuery,
GetHostedSessionActivitiesDocument,
Expand Down Expand Up @@ -57,7 +56,6 @@ export const useSessionActivities = ({
* returned via these subscriptions will automatically be updated in the cache,
* which means the `activities` array will also be automatically updated.
*/
useOnSessionActivityUpdatedSubscription({ variables })
useOnSessionActivityCompletedSubscription({ variables })

const sortActivitiesByDate = (activities: Activity[]): Activity[] => {
Expand Down

0 comments on commit b359512

Please sign in to comment.