Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Allow popping out a Jitsi widget to respect Desktop web_base_url co…
Browse files Browse the repository at this point in the history
…nfig (#12376)

* Allow popping out a Jitsi widget to respect Desktop `web_base_url` config

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
  • Loading branch information
t3chguy authored Mar 26, 2024
1 parent 2119004 commit ddadbf6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/WidgetUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ export default class WidgetUtils {
// safe to send.
// We'll end up using a local render URL when we see a Jitsi widget anyways, so this is
// really just for backwards compatibility and to appease the spec.
baseUrl = "https://app.element.io/";
baseUrl = PlatformPeg.get()!.baseUrl;
}
const url = new URL("jitsi.html#" + queryString, baseUrl); // this strips hash fragment from baseUrl
return url.href;
Expand Down
9 changes: 9 additions & 0 deletions test/utils/WidgetUtils-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ import WidgetUtils from "../../src/utils/WidgetUtils";
import { mockPlatformPeg } from "../test-utils";

describe("getLocalJitsiWrapperUrl", () => {
beforeEach(() => {
Object.defineProperty(window, "location", {
value: {
origin: "https://app.element.io",
pathname: "",
},
});
});

it("should generate jitsi URL (for defaults)", () => {
mockPlatformPeg();

Expand Down

0 comments on commit ddadbf6

Please sign in to comment.