mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-24 18:59:17 +00:00
Conform more code to strict null checking (#10153)
* Conform more code to strict null checking * Conform more code to strict null checking * Iterate * Iterate
This commit is contained in:
committed by
GitHub
parent
a4ff959aa1
commit
145a5a8a8d
@@ -358,7 +358,7 @@ function inviteUser(event: MessageEvent<any>, roomId: string, userId: string): v
|
||||
if (room) {
|
||||
// if they are already invited or joined we can resolve immediately.
|
||||
const member = room.getMember(userId);
|
||||
if (member && ["join", "invite"].includes(member.membership)) {
|
||||
if (member && ["join", "invite"].includes(member.membership!)) {
|
||||
sendResponse(event, {
|
||||
success: true,
|
||||
});
|
||||
@@ -389,7 +389,7 @@ function kickUser(event: MessageEvent<any>, roomId: string, userId: string): voi
|
||||
if (room) {
|
||||
// if they are already not in the room we can resolve immediately.
|
||||
const member = room.getMember(userId);
|
||||
if (!member || getEffectiveMembership(member.membership) === EffectiveMembership.Leave) {
|
||||
if (!member || getEffectiveMembership(member.membership!) === EffectiveMembership.Leave) {
|
||||
sendResponse(event, {
|
||||
success: true,
|
||||
});
|
||||
@@ -472,7 +472,7 @@ function setWidget(event: MessageEvent<any>, roomId: string | null): void {
|
||||
} else {
|
||||
// Room widget
|
||||
if (!roomId) {
|
||||
sendError(event, _t("Missing roomId."), null);
|
||||
sendError(event, _t("Missing roomId."));
|
||||
return;
|
||||
}
|
||||
WidgetUtils.setRoomWidget(
|
||||
@@ -675,7 +675,7 @@ function canSendEvent(event: MessageEvent<any>, roomId: string): void {
|
||||
sendError(event, _t("You are not in this room."));
|
||||
return;
|
||||
}
|
||||
const me = client.credentials.userId;
|
||||
const me = client.credentials.userId!;
|
||||
|
||||
let canSend = false;
|
||||
if (isState) {
|
||||
|
||||
Reference in New Issue
Block a user