diff --git a/packages/restapi/src/lib/space/acceptPromotionRequest.ts b/packages/restapi/src/lib/space/acceptPromotionRequest.ts index 8407d7004..c3e21f777 100644 --- a/packages/restapi/src/lib/space/acceptPromotionRequest.ts +++ b/packages/restapi/src/lib/space/acceptPromotionRequest.ts @@ -48,9 +48,7 @@ export async function acceptPromotionRequest( const updatedLiveSpaceData = produce(oldLiveSpaceData, (draft) => { const listnerIndex = draft.listeners.findIndex((listner) => listner.address === pCAIP10ToWallet(promoteeAddress)); - if (listnerIndex > -1) draft.listeners[listnerIndex].handRaised = false; - - draft.listeners.splice(listnerIndex, 1); + if (listnerIndex > -1) draft.listeners[listnerIndex].handRaised = false; const promotedListener: AdminPeer = { address: draft.listeners[listnerIndex].address, @@ -58,6 +56,8 @@ export async function acceptPromotionRequest( audio: true, } + draft.listeners.splice(listnerIndex, 1); + draft.speakers.push(promotedListener); }); @@ -67,7 +67,7 @@ export async function acceptPromotionRequest( env: this.env, spaceId: this.spaceSpecificData.spaceId, signer: this.signer, - action: META_ACTION.USER_INTERACTION, + action: META_ACTION.PROMOTE_TO_SPEAKER, }); // accept the promotion request