Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for user value in CollaboratorsPanel #383

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/collaboration/src/collaboratorspanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@
const state = this._awareness.getStates() as any;
const collaborators: ICollaboratorAwareness[] = [];

state.forEach((value: ICollaboratorAwareness, key: any) => {
state.forEach((value: Partial<ICollaboratorAwareness>, key: any) => {
if (
this._currentUser.isReady &&
value.user &&
value.user.username !== this._currentUser.identity!.username

Check warning on line 106 in packages/collaboration/src/collaboratorspanel.tsx

View workflow job for this annotation

GitHub Actions / Run pre-commit hook

Forbidden non-null assertion
) {
collaborators.push(value);
collaborators.push(value as ICollaboratorAwareness);
}
});
this._collaboratorsChanged.emit(collaborators);
Expand Down Expand Up @@ -165,7 +166,7 @@
const fileTypes = props.docRegistry
?.getFileTypesForPath(path[1])
?.filter(ft => ft.icon !== undefined);
const icon = fileTypes ? fileTypes[0].icon! : fileIcon;

Check warning on line 169 in packages/collaboration/src/collaboratorspanel.tsx

View workflow job for this annotation

GitHub Actions / Run pre-commit hook

Forbidden non-null assertion
const iconClass: string | undefined = fileTypes
? fileTypes[0].iconClass
: undefined;
Expand Down
Loading