Skip to content

fix(pages.notes): add current users at note's header#199

Merged
unknownproperty merged 5 commits into
mainfrom
144
Jun 23, 2026
Merged

fix(pages.notes): add current users at note's header#199
unknownproperty merged 5 commits into
mainfrom
144

Conversation

@avea-maria

Copy link
Copy Markdown
Contributor

fix #144

Для реализации нужно было отслеживать пользователей внутри едитора через WS и передвать информацию о пользователях в header. Но header не входил в context в котором находился едитор, а поднять context выше не представлялось правильным решением, т.к. едитор и заметки находятся в разных пакетах.
Решила сделать через общий useState и дриллинг пропсов.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Name Status Preview
xi.web ✔️Success✔️ Visit Preview


useEffect(() => {
setUsers?.(users);
}, [setUsers, users]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне не очень нравится такое использование useEffect. Может быть вместо проброса setUsers через пропсы и использования users и setUsers сделать для них стор на Zustand?

provider.awareness.off('change', handleGetUserIds);
}
};
}, [provider.awareness, users]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь будто users лишний, так как при изменении, в том числе через setUsers мы будем вновь с 0 пересоздавать весь useEffect

@avea-maria avea-maria changed the title fix(pages.note): add current users at note's header fix(pages.notes): add current users at note's header Jun 22, 2026
@unknownproperty unknownproperty merged commit 64e39a4 into main Jun 23, 2026
6 checks passed
@unknownproperty unknownproperty deleted the 144 branch June 23, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants