From f239242f0b51212126db320c410548a0e0d3da52 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Tue, 30 Jul 2024 12:01:26 -0400 Subject: [PATCH] Lint --- src/ClientWidgetApi.ts | 53 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/ClientWidgetApi.ts b/src/ClientWidgetApi.ts index f154573..854f8c1 100644 --- a/src/ClientWidgetApi.ts +++ b/src/ClientWidgetApi.ts @@ -558,37 +558,38 @@ export class ClientWidgetApi extends EventEmitter { }); } -private handleUpdateDelayedEvent(request: IUpdateDelayedEventFromWidgetActionRequest) { - if (!request.data.delay_id) { - return this.transport.reply(request, { - error: {message: "Invalid request - missing delay_id"}, - }); - } + private handleUpdateDelayedEvent(request: IUpdateDelayedEventFromWidgetActionRequest) { + if (!request.data.delay_id) { + return this.transport.reply(request, { + error: {message: "Invalid request - missing delay_id"}, + }); + } - if (!this.hasCapability(MatrixCapabilities.MSC4157UpdateDelayedEvent)) { - return this.transport.reply(request, { - error: {message: "Missing capability"}, - }); - } + if (!this.hasCapability(MatrixCapabilities.MSC4157UpdateDelayedEvent)) { + return this.transport.reply(request, { + error: {message: "Missing capability"}, + }); + } - switch (request.data.action) { - case UpdateDelayedEventAction.Cancel: - case UpdateDelayedEventAction.Restart: - case UpdateDelayedEventAction.Send: - this.driver.updateDelayedEvent(request.data.delay_id, request.data.action).then(() => { - return this.transport.reply(request, {}); - }).catch(e => { - console.error("error updating delayed event: ", e); + switch (request.data.action) { + case UpdateDelayedEventAction.Cancel: + case UpdateDelayedEventAction.Restart: + case UpdateDelayedEventAction.Send: + this.driver.updateDelayedEvent(request.data.delay_id, request.data.action).then(() => { + return this.transport.reply(request, {}); + }).catch(e => { + console.error("error updating delayed event: ", e); + return this.transport.reply(request, { + error: {message: "Error updating delayed event"}, + }); + }); + break; + default: return this.transport.reply(request, { - error: {message: "Error updating delayed event"}, + error: {message: "Invalid request - unsupported action"}, }); - }); - default: - return this.transport.reply(request, { - error: {message: "Invalid request - unsupported action"}, - }); + } } -} private async handleSendToDevice(request: ISendToDeviceFromWidgetActionRequest): Promise { if (!request.data.type) {