FIX: 404 sending beacon "leave all" on subfolder install

This commit is contained in:
Renato Atilio 2022-09-27 15:57:38 -03:00 committed by GitHub
parent cc4af80c7d
commit 4c085873e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import userPresent, {
import { bind } from "discourse-common/utils/decorators"; import { bind } from "discourse-common/utils/decorators";
import Evented from "@ember/object/evented"; import Evented from "@ember/object/evented";
import { isTesting } from "discourse-common/config/environment"; import { isTesting } from "discourse-common/config/environment";
import getURL from "discourse-common/lib/get-url";
const PRESENCE_INTERVAL_S = 30; const PRESENCE_INTERVAL_S = 30;
const PRESENCE_DEBOUNCE_MS = isTesting() ? 0 : 500; const PRESENCE_DEBOUNCE_MS = isTesting() ? 0 : 500;
@ -472,7 +473,7 @@ export default class PresenceService extends Service {
channelsToLeave.forEach((ch) => data.append("leave_channels[]", ch)); channelsToLeave.forEach((ch) => data.append("leave_channels[]", ch));
data.append("authenticity_token", Session.currentProp("csrfToken")); data.append("authenticity_token", Session.currentProp("csrfToken"));
navigator.sendBeacon("/presence/update", data); navigator.sendBeacon(getURL("/presence/update"), data);
} }
_dedupQueue() { _dedupQueue() {