From 3efa699b88e2bd3a4e4f29a6fbbe6f7febe4c887 Mon Sep 17 00:00:00 2001 From: Jaiwanth Date: Sat, 14 Aug 2021 00:14:57 +0530 Subject: [PATCH] Delint --- src/components/views/messages/MAudioBody.tsx | 1 + src/components/views/messages/MFileBody.tsx | 1 + src/components/views/messages/MImageBody.tsx | 3 +- src/components/views/messages/MVideoBody.tsx | 1 + src/i18n/strings/en_EN.json | 37 ++++++++++---------- src/utils/exportUtils/JSONExport.ts | 1 - src/utils/exportUtils/PlainTextExport.ts | 1 - 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/components/views/messages/MAudioBody.tsx b/src/components/views/messages/MAudioBody.tsx index 836b1eb79a..6cbd2f2b70 100644 --- a/src/components/views/messages/MAudioBody.tsx +++ b/src/components/views/messages/MAudioBody.tsx @@ -86,6 +86,7 @@ export default class MAudioBody extends React.PureComponent if (this.props.forExport) { const content = this.props.mxEvent.getContent(); + // During export, the content url will point to the MSC, which will later point to a local url const contentUrl = content.file?.url || content.url; return ( diff --git a/src/components/views/messages/MFileBody.tsx b/src/components/views/messages/MFileBody.tsx index 3675b14295..49c148c56c 100644 --- a/src/components/views/messages/MFileBody.tsx +++ b/src/components/views/messages/MFileBody.tsx @@ -213,6 +213,7 @@ export default class MFileBody extends React.Component { if (this.props.forExport) { const content = this.props.mxEvent.getContent(); + // During export, the content url will point to the MSC, which will later point to a local url return { placeholder } diff --git a/src/components/views/messages/MImageBody.tsx b/src/components/views/messages/MImageBody.tsx index ae82c57a5e..2d402bdc21 100644 --- a/src/components/views/messages/MImageBody.tsx +++ b/src/components/views/messages/MImageBody.tsx @@ -164,7 +164,8 @@ export default class MImageBody extends React.Component { protected getContentUrl(): string { const content: IMediaEventContent = this.props.mxEvent.getContent(); - if (this.props.forExport) return content.url || content.file.url; + // During export, the content url will point to the MSC, which will later point to a local url + if (this.props.forExport) return content.url || content.file?.url; if (this.media.isEncrypted) { return this.state.decryptedUrl; } else { diff --git a/src/components/views/messages/MVideoBody.tsx b/src/components/views/messages/MVideoBody.tsx index 3239482515..8cb03bfa7b 100644 --- a/src/components/views/messages/MVideoBody.tsx +++ b/src/components/views/messages/MVideoBody.tsx @@ -78,6 +78,7 @@ export default class MVideoBody extends React.PureComponent private getContentUrl(): string|null { const content = this.props.mxEvent.getContent(); + // During export, the content url will point to the MSC, which will later point to a local url if (this.props.forExport) return content.file?.url || content.url; const media = mediaFromContent(content); if (media.isEncrypted) { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 090ee23ba8..d62871af23 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -2329,25 +2329,6 @@ "There was an error updating your community. The server is unable to process your request.": "There was an error updating your community. The server is unable to process your request.", "Update community": "Update community", "An error has occurred.": "An error has occurred.", - "Enter a number between %(min)s and %(max)s": "Enter a number between %(min)s and %(max)s", - "Size can only be a number between %(min)s MB and %(max)s MB": "Size can only be a number between %(min)s MB and %(max)s MB", - "Number of messages can only be a number between %(min)s and %(max)s": "Number of messages can only be a number between %(min)s and %(max)s", - "Number of messages": "Number of messages", - "MB": "MB", - "Export Cancelled": "Export Cancelled", - "The export was cancelled successfully": "The export was cancelled successfully", - "Export Successful": "Export Successful", - "Your messages were successfully exported": "Your messages were successfully exported", - "Are you sure you want to stop exporting your data? If you do, you'll need to start over.": "Are you sure you want to stop exporting your data? If you do, you'll need to start over.", - "Stop": "Stop", - "Exporting your data": "Exporting your data", - "Export Chat": "Export Chat", - "Select from the options below to export chats from your timeline": "Select from the options below to export chats from your timeline", - "Format": "Format", - "Size Limit": "Size Limit", - "Include Attachments": "Include Attachments", - "Processing...": "Processing...", - "Export": "Export", "Feedback sent": "Feedback sent", "Rate %(brand)s": "Rate %(brand)s", "Tell us below how you feel about %(brand)s so far.": "Tell us below how you feel about %(brand)s so far.", @@ -3048,6 +3029,24 @@ "Space Autocomplete": "Space Autocomplete", "Users": "Users", "User Autocomplete": "User Autocomplete", + "Enter a number between %(min)s and %(max)s": "Enter a number between %(min)s and %(max)s", + "Size can only be a number between %(min)s MB and %(max)s MB": "Size can only be a number between %(min)s MB and %(max)s MB", + "Number of messages can only be a number between %(min)s and %(max)s": "Number of messages can only be a number between %(min)s and %(max)s", + "Number of messages": "Number of messages", + "MB": "MB", + "Export Cancelled": "Export Cancelled", + "The export was cancelled successfully": "The export was cancelled successfully", + "Export Successful": "Export Successful", + "Your messages were successfully exported": "Your messages were successfully exported", + "Are you sure you want to stop exporting your data? If you do, you'll need to start over.": "Are you sure you want to stop exporting your data? If you do, you'll need to start over.", + "Stop": "Stop", + "Exporting your data": "Exporting your data", + "Export Chat": "Export Chat", + "Select from the options below to export chats from your timeline": "Select from the options below to export chats from your timeline", + "Format": "Format", + "Size Limit": "Size Limit", + "Include Attachments": "Include Attachments", + "Export": "Export", "We'll store an encrypted copy of your keys on our server. Secure your backup with a Security Phrase.": "We'll store an encrypted copy of your keys on our server. Secure your backup with a Security Phrase.", "For maximum security, this should be different from your account password.": "For maximum security, this should be different from your account password.", "Enter a Security Phrase": "Enter a Security Phrase", diff --git a/src/utils/exportUtils/JSONExport.ts b/src/utils/exportUtils/JSONExport.ts index fe9b81fd0a..8166920b6a 100644 --- a/src/utils/exportUtils/JSONExport.ts +++ b/src/utils/exportUtils/JSONExport.ts @@ -22,7 +22,6 @@ import { haveTileForEvent } from "../../components/views/rooms/EventTile"; import { ExportType } from "./exportUtils"; import { IExportOptions } from "./exportUtils"; import { EventType } from "matrix-js-sdk/src/@types/event"; -import { MutableRefObject } from "react"; export default class JSONExporter extends Exporter { protected totalSize = 0; diff --git a/src/utils/exportUtils/PlainTextExport.ts b/src/utils/exportUtils/PlainTextExport.ts index c95866ce9b..8e3ba81c4e 100644 --- a/src/utils/exportUtils/PlainTextExport.ts +++ b/src/utils/exportUtils/PlainTextExport.ts @@ -23,7 +23,6 @@ import { haveTileForEvent } from "../../components/views/rooms/EventTile"; import { ExportType } from "./exportUtils"; import { IExportOptions } from "./exportUtils"; import { textForEvent } from "../../TextForEvent"; -import { MutableRefObject } from "react"; export default class PlainTextExporter extends Exporter { protected totalSize: number;