Repository: directus/directus
File: app/src/composables/use-collab.ts (TypeScript)

Code before:

		if (!isEqual(message.changes, edits.value[message.field])) {
			// Can't directly assign message.changes here because edits can be a computed value
			edits.value = { ...edits.value, [message.field]: message.changes };
		}
	}

	async function receiveDelete() {
		notificationsStore.add({
			title: t('item_deleted'),
			persist: true,
		});

		router.push(`/content/${item.value ? collection.value : ''}`);
	}

	async function receiveJoin(message: JoinMessage) {
		const existingInfo = users.value.find((user) => user.id === message.user);

		const user = existingInfo
			? existingInfo
			: await sdk
					.request<CollabUser>(
						readUser(message.user, {
							// TODO: Update this once https://github.com/directus/directus/issues/26558 is Done
							fields: ['id', 'first_name', 'last_name', 'avatar.id', 'avatar.modified_on'] as ('id' | 'first_name' | 'last_name' | 'avatar')[],
						}),
					)
					.catch(() => ({}));

		users.value = [...users.value, { ...user, id: message.user, color: message.color, connection: message.connection }];
	}

	async function receiveLeave(message: LeaveMessage) {
		users.value = users.value.filter((user) => user.connection !== message.connection);

		delete focused.value[message.connection];

		if (message.connection === connectionId.value) {
			joining = false;
			roomId.value = null;
			connectionId.value = null;
			focused.value = {};
			users.value = [];

			setTimeout(join, Math.random() * 1000 + 500);
		}
	}

	async function receiveSave() {
		await getItem();

Review comment (suggestion):
```suggestion
							fields: ['id', 'first_name', 'last_name', {'avatar': ['id', 'modified_on']}],
```

Code after:

		if (!isEqual(message.changes, edits.value[message.field])) {
			// Can't directly assign message.changes here because edits can be a computed value
			edits.value = { ...edits.value, [message.field]: message.changes };
		}
	}

	async function receiveDelete() {
		notificationsStore.add({
			title: t('item_deleted'),
			persist: true,
		});

		router.push(`/content/${item.value ? collection.value : ''}`);
	}

	async function receiveJoin(message: JoinMessage) {
		const existingInfo = users.value.find((user) => user.id === message.user);

		const user = existingInfo
			? existingInfo
			: await sdk
					.request(
						readUser(message.user, {
							// TODO: Update this once https://github.com/directus/directus/issues/26558 is Done
							fields: ['id', 'first_name', 'last_name', { avatar: ['id', 'modified_on']}] as (keyof DirectusUser)[],
						}),
					)
					.catch(() => ({}));

		users.value = [...users.value, { ...user, id: message.user, color: message.color, connection: message.connection }];
	}

	async function receiveLeave(message: LeaveMessage) {
		users.value = users.value.filter((user) => user.connection !== message.connection);

		delete focused.value[message.connection];

		if (message.connection === connectionId.value) {
			joining = false;
			roomId.value = null;
			connectionId.value = null;
			focused.value = {};
			users.value = [];

			setTimeout(join, Math.random() * 1000 + 500);
		}
	}

	async function receiveSave() {
		await getItem();