Skip to content

Commit

Permalink
fix(fe2): user activity tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
fabis94 committed Feb 15, 2024
1 parent 0454b39 commit af30d3c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/frontend-2/lib/viewer/composables/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function useViewerUserActivityBroadcasting(
const { isEnabled: isEmbedEnabled } = useEmbed()

const invokeMutation = async (message: ViewerUserActivityMessageInput) => {
if (!isLoggedIn.value || isEmbedEnabled) return false
if (!isLoggedIn.value || isEmbedEnabled.value) return false
const result = await apollo
.mutate({
mutation: broadcastViewerUserActivityMutation,
Expand Down Expand Up @@ -176,7 +176,7 @@ export function useViewerUserActivityTracking(params: {
const incomingSessionId = event.sessionId

if (sessionId.value === incomingSessionId) return
if (!isEmbedEnabled && status === ViewerUserActivityStatus.Disconnected) {
if (!isEmbedEnabled.value && status === ViewerUserActivityStatus.Disconnected) {
triggerNotification({
description: `${users.value[incomingSessionId]?.userName || 'A user'} left.`,
type: ToastNotificationType.Info
Expand Down Expand Up @@ -208,7 +208,10 @@ export function useViewerUserActivityTracking(params: {
lastUpdate: dayjs()
}

if (!isEmbedEnabled && !Object.keys(users.value).includes(incomingSessionId)) {
if (
!isEmbedEnabled.value &&
!Object.keys(users.value).includes(incomingSessionId)
) {
triggerNotification({
description: `${userData.userName} joined.`,
type: ToastNotificationType.Info
Expand Down

0 comments on commit af30d3c

Please sign in to comment.