UBERF-9462 Restore room access (#7971)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2025-02-11 15:39:51 +07:00 committed by GitHub
parent d24e9a1eb4
commit 6f790a52c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -221,7 +221,7 @@ async function setDefaultRoomAccess (info: ParticipantInfo, control: TriggerCont
const roomInfos = await control.queryFind(control.ctx, love.class.RoomInfo, {})
const oldRoomInfo = roomInfos.find((ri) => ri.persons.includes(info.person))
if (oldRoomInfo !== undefined) {
if (oldRoomInfo.persons.length === 0) {
if (oldRoomInfo.persons.length === 1 && oldRoomInfo.persons[0] === info.person) {
res.push(control.txFactory.createTxRemoveDoc(oldRoomInfo._class, oldRoomInfo.space, oldRoomInfo._id))
const resetAccessTx = control.txFactory.createTxUpdateDoc(