Skip to content

Commit dd0e51f

Browse files
authored
fix(users.getStatus): safely include optional message field
1 parent f8b7afc commit dd0e51f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/meteor/app/api/server/v1/users.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ const usersEndpoints = API.v1
911911
_id: user?._id,
912912
connectionStatus: (user?.statusConnection || 'offline') as 'online' | 'offline' | 'away' | 'busy',
913913
status: (user?.status || 'offline') as 'online' | 'offline' | 'away' | 'busy',
914-
message: user?.statusText,
914+
...(user?.statusText && { message: user.statusText }),
915915
});
916916
}
917917

@@ -920,7 +920,7 @@ const usersEndpoints = API.v1
920920
return API.v1.success({
921921
_id: user._id,
922922
status: (user.status || 'offline') as 'online' | 'offline' | 'away' | 'busy',
923-
message: user?.statusText,
923+
...(user?.statusText && { message: user.statusText }),
924924
});
925925
},
926926
);

0 commit comments

Comments
 (0)