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

Commit

Permalink
Fix lint issues introduced
Browse files Browse the repository at this point in the history
Signed-off-by: Lars Wickel <[email protected]>
  • Loading branch information
Lars Wickel committed Oct 9, 2023
1 parent ce69263 commit a324024
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/utils/permalinks/ElementPermalinkConstructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ export default class ElementPermalinkConstructor extends PermalinkConstructor {
}

public forEvent(roomId: string, eventId: string, serverCandidates: string[], ispill = false): string {
if(ispill) {
if (ispill) {
return `https://matrix.to/#/${roomId}/${eventId}${this.encodeServerCandidates(serverCandidates)}`;
}
return `${this.elementUrl}/#/room/${roomId}/${eventId}${this.encodeServerCandidates(serverCandidates)}`;
}

public forRoom(roomIdOrAlias: string, serverCandidates?: string[], ispill = false): string {
if(ispill) {
if (ispill) {
return `https://matrix.to/#/${roomIdOrAlias}${this.encodeServerCandidates(serverCandidates)}`;
}
return `${this.elementUrl}/#/room/${roomIdOrAlias}${this.encodeServerCandidates(serverCandidates)}`;
}

public forUser(userId: string, ispill = false): string {
if(ispill) {
if (ispill) {
return `https://matrix.to/#/${userId}`;
}
return `${this.elementUrl}/#/user/${userId}`;
Expand Down
5 changes: 3 additions & 2 deletions test/editor/serialize-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { mocked } from "jest-mock";
import EditorModel from "../../src/editor/model";
import { htmlSerializeIfNeeded } from "../../src/editor/serialize";
import { createPartCreator } from "./mock";
import { IConfigOptions } from "../../src/IConfigOptions";
import SettingsStore from "../../src/settings/SettingsStore";
import SdkConfig from "../../src/SdkConfig";

Expand Down Expand Up @@ -108,9 +109,9 @@ describe("editor/serialize", function () {
expect(html).toBe('<ol start="2021">\n<li>foo</li>\n</ol>\n');
});
describe("with permalink_prefix set", function () {
const sdkConfigGet = SdkConfig.get
const sdkConfigGet = SdkConfig.get;
beforeEach(() => {
jest.spyOn(SdkConfig, "get").mockImplementation((key: string, altCaseName?: string) => {
jest.spyOn(SdkConfig, "get").mockImplementation((key: keyof IConfigOptions, altCaseName?: string) => {
if (key === "permalink_prefix") {
return "https://element.fs.tld";
} else return sdkConfigGet(key, altCaseName);
Expand Down
5 changes: 3 additions & 2 deletions test/utils/permalinks/Permalinks-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
parsePermalink,
RoomPermalinkCreator,
} from "../../../src/utils/permalinks/Permalinks";
import { IConfigOptions } from "../../../src/IConfigOptions";
import SdkConfig from "../../../src/SdkConfig";
import { getMockClientWithEventEmitter } from "../../test-utils";

Expand Down Expand Up @@ -392,8 +393,8 @@ describe("Permalinks", function () {
});

it("should use permalink_prefix for permalinks", function () {
const sdkConfigGet = SdkConfig.get
jest.spyOn(SdkConfig, "get").mockImplementation((key: string, altCaseName?: string) => {
const sdkConfigGet = SdkConfig.get;
jest.spyOn(SdkConfig, "get").mockImplementation((key: keyof IConfigOptions, altCaseName?: string) => {
if (key === "permalink_prefix") {
return "https://element.fs.tld";
} else return sdkConfigGet(key, altCaseName);
Expand Down

0 comments on commit a324024

Please sign in to comment.