Auto-fix lint errors
This commit is contained in:
parent
4c5720a573
commit
ae0a8b8da4
625 changed files with 3170 additions and 3232 deletions
|
@ -46,9 +46,9 @@ import ActiveWidgetStore from "../ActiveWidgetStore";
|
|||
import { objectShallowClone } from "../../utils/objects";
|
||||
import defaultDispatcher from "../../dispatcher/dispatcher";
|
||||
import { ElementWidgetActions, IViewRoomApiRequest } from "./ElementWidgetActions";
|
||||
import {ModalWidgetStore} from "../ModalWidgetStore";
|
||||
import { ModalWidgetStore } from "../ModalWidgetStore";
|
||||
import ThemeWatcher from "../../settings/watchers/ThemeWatcher";
|
||||
import {getCustomTheme} from "../../theme";
|
||||
import { getCustomTheme } from "../../theme";
|
||||
import CountlyAnalytics from "../../CountlyAnalytics";
|
||||
import { ElementWidgetCapabilities } from "./ElementWidgetCapabilities";
|
||||
import { MatrixEvent, IEvent } from "matrix-js-sdk/src/models/event";
|
||||
|
@ -180,17 +180,17 @@ export class StopGapWidget extends EventEmitter {
|
|||
* The URL to use in the iframe
|
||||
*/
|
||||
public get embedUrl(): string {
|
||||
return this.runUrlTemplate({asPopout: false});
|
||||
return this.runUrlTemplate({ asPopout: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL to use in the popout
|
||||
*/
|
||||
public get popoutUrl(): string {
|
||||
return this.runUrlTemplate({asPopout: true});
|
||||
return this.runUrlTemplate({ asPopout: true });
|
||||
}
|
||||
|
||||
private runUrlTemplate(opts = {asPopout: false}): string {
|
||||
private runUrlTemplate(opts = { asPopout: false }): string {
|
||||
const templated = this.mockWidget.getCompleteUrl({
|
||||
widgetRoomId: this.roomId,
|
||||
currentUserId: MatrixClientPeg.get().getUserId(),
|
||||
|
@ -244,7 +244,7 @@ export class StopGapWidget extends EventEmitter {
|
|||
error: {
|
||||
message: "Unable to open modal at this time",
|
||||
},
|
||||
})
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -270,14 +270,14 @@ export class StopGapWidget extends EventEmitter {
|
|||
const targetRoomId = (ev.detail.data || {}).room_id;
|
||||
if (!targetRoomId) {
|
||||
return this.messaging.transport.reply(ev.detail, <IWidgetApiErrorResponseData>{
|
||||
error: {message: "Room ID not supplied."},
|
||||
error: { message: "Room ID not supplied." },
|
||||
});
|
||||
}
|
||||
|
||||
// Check the widget's permission
|
||||
if (!this.messaging.hasCapability(ElementWidgetCapabilities.CanChangeViewedRoom)) {
|
||||
return this.messaging.transport.reply(ev.detail, <IWidgetApiErrorResponseData>{
|
||||
error: {message: "This widget does not have permission for this action (denied)."},
|
||||
error: { message: "This widget does not have permission for this action (denied)." },
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -335,12 +335,12 @@ export class StopGapWidget extends EventEmitter {
|
|||
this.messaging.transport.reply(ev.detail, <IWidgetApiRequestEmptyData>{});
|
||||
|
||||
// First close the stickerpicker
|
||||
defaultDispatcher.dispatch({action: "stickerpicker_close"});
|
||||
defaultDispatcher.dispatch({ action: "stickerpicker_close" });
|
||||
|
||||
// Now open the integration manager
|
||||
// TODO: Spec this interaction.
|
||||
const data = ev.detail.data;
|
||||
const integType = data?.integType
|
||||
const integType = data?.integType;
|
||||
const integId = <string>data?.integId;
|
||||
|
||||
// TODO: Open the right integration manager for the widget
|
||||
|
@ -384,7 +384,7 @@ export class StopGapWidget extends EventEmitter {
|
|||
}
|
||||
}
|
||||
|
||||
public stop(opts = {forceDestroy: false}) {
|
||||
public stop(opts = { forceDestroy: false }) {
|
||||
if (!opts?.forceDestroy && ActiveWidgetStore.getPersistentWidgetId() === this.mockWidget.id) {
|
||||
console.log("Skipping destroy - persistent widget");
|
||||
return;
|
||||
|
|
|
@ -43,8 +43,8 @@ import { EventType } from "matrix-js-sdk/src/@types/event";
|
|||
import { CHAT_EFFECTS } from "../../effects";
|
||||
import { containsEmoji } from "../../effects/utils";
|
||||
import dis from "../../dispatcher/dispatcher";
|
||||
import {tryTransformPermalinkToLocalHref} from "../../utils/permalinks/Permalinks";
|
||||
import {MatrixEvent} from "matrix-js-sdk/src/models/event";
|
||||
import { tryTransformPermalinkToLocalHref } from "../../utils/permalinks/Permalinks";
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
|
||||
// TODO: Purge this from the universe
|
||||
|
||||
|
@ -136,13 +136,13 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
|||
if (eventType === EventType.RoomMessage) {
|
||||
CHAT_EFFECTS.forEach((effect) => {
|
||||
if (containsEmoji(content, effect.emojis)) {
|
||||
dis.dispatch({action: `effects.${effect.command}`});
|
||||
dis.dispatch({ action: `effects.${effect.command}` });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {roomId, eventId: r.event_id};
|
||||
return { roomId, eventId: r.event_id };
|
||||
}
|
||||
|
||||
public async readRoomEvents(eventType: string, msgtype: string | undefined, limit: number): Promise<object[]> {
|
||||
|
@ -199,13 +199,13 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
|||
};
|
||||
|
||||
if (oidcState === OIDCState.Denied) {
|
||||
return observer.update({state: OpenIDRequestState.Blocked});
|
||||
return observer.update({ state: OpenIDRequestState.Blocked });
|
||||
}
|
||||
if (oidcState === OIDCState.Allowed) {
|
||||
return observer.update({state: OpenIDRequestState.Allowed, token: await getToken()});
|
||||
return observer.update({ state: OpenIDRequestState.Allowed, token: await getToken() });
|
||||
}
|
||||
|
||||
observer.update({state: OpenIDRequestState.PendingUserConfirmation});
|
||||
observer.update({ state: OpenIDRequestState.PendingUserConfirmation });
|
||||
|
||||
Modal.createTrackedDialog("OpenID widget permissions", '', WidgetOpenIDPermissionsDialog, {
|
||||
widget: this.forWidget,
|
||||
|
@ -214,10 +214,10 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
|||
|
||||
onFinished: async (confirm) => {
|
||||
if (!confirm) {
|
||||
return observer.update({state: OpenIDRequestState.Blocked});
|
||||
return observer.update({ state: OpenIDRequestState.Blocked });
|
||||
}
|
||||
|
||||
return observer.update({state: OpenIDRequestState.Allowed, token: await getToken()});
|
||||
return observer.update({ state: OpenIDRequestState.Allowed, token: await getToken() });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -425,7 +425,7 @@ export class WidgetLayoutStore extends ReadyWatchingStore {
|
|||
const allWidgets = this.getAllWidgets(room);
|
||||
if (!allWidgets.some(([w])=> w.id === widget.id)) return; // invalid
|
||||
this.updateUserLayout(room, {
|
||||
[widget.id]: {container: toContainer},
|
||||
[widget.id]: { container: toContainer },
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -436,9 +436,9 @@ export class WidgetLayoutStore extends ReadyWatchingStore {
|
|||
|
||||
public copyLayoutToRoom(room: Room) {
|
||||
const allWidgets = this.getAllWidgets(room);
|
||||
const evContent: ILayoutStateEvent = {widgets: {}};
|
||||
const evContent: ILayoutStateEvent = { widgets: {} };
|
||||
for (const [widget, container] of allWidgets) {
|
||||
evContent.widgets[widget.id] = {container};
|
||||
evContent.widgets[widget.id] = { container };
|
||||
if (container === Container.Top) {
|
||||
const containerWidgets = this.getContainerWidgets(room, container);
|
||||
const idx = containerWidgets.findIndex(w => w.id === widget.id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue