mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Do not send presence leave beacon if not present in any channels
This commit is contained in:
@@ -415,9 +415,14 @@ export default class PresenceService extends Service {
|
||||
.filter((e) => e.type === "leave")
|
||||
.map((e) => e.channel);
|
||||
|
||||
channelsToLeave.push(...this._presentChannels);
|
||||
|
||||
if (channelsToLeave.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const data = new FormData();
|
||||
data.append("client_id", this.messageBus.clientId);
|
||||
this._presentChannels.forEach((ch) => data.append("leave_channels[]", ch));
|
||||
channelsToLeave.forEach((ch) => data.append("leave_channels[]", ch));
|
||||
|
||||
data.append("authenticity_token", Session.currentProp("csrfToken"));
|
||||
|
||||
Reference in New Issue
Block a user