Skip to content

Commit 2b6c3de

Browse files
authored
clean up text preview support which was removed earlier (#3251)
1 parent 8dd6dd4 commit 2b6c3de

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

web-app/src/screens/Console/Buckets/ListBuckets/Objects/Preview/PreviewFileContent.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ const PreviewFile = ({
113113
"&.image": {
114114
height: 500,
115115
},
116-
"&.text": {
117-
height: 700,
118-
},
119116
"&.audio": {
120117
height: 150,
121118
},

web-app/src/screens/Console/Buckets/ListBuckets/Objects/utils.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,7 @@ class BrowserDownload {
194194
}
195195
}
196196

197-
export type AllowedPreviews =
198-
| "image"
199-
| "pdf"
200-
| "text"
201-
| "audio"
202-
| "video"
203-
| "none";
197+
export type AllowedPreviews = "image" | "pdf" | "audio" | "video" | "none";
204198
export const contentTypePreview = (contentType: string): AllowedPreviews => {
205199
if (contentType) {
206200
const mimeObjectType = (contentType || "").toLowerCase();
@@ -211,9 +205,6 @@ export const contentTypePreview = (contentType: string): AllowedPreviews => {
211205
if (mimeObjectType.includes("pdf")) {
212206
return "pdf";
213207
}
214-
if (mimeObjectType.includes("text")) {
215-
return "text";
216-
}
217208
if (mimeObjectType.includes("audio")) {
218209
return "audio";
219210
}
@@ -243,7 +234,6 @@ export const extensionPreview = (fileName: string): AllowedPreviews => {
243234
"png",
244235
"heic",
245236
];
246-
const textExtensions = ["txt"];
247237
const pdfExtensions = ["pdf"];
248238
const audioExtensions = ["wav", "mp3", "alac", "aiff", "dsd", "pcm"];
249239
const videoExtensions = [
@@ -275,10 +265,6 @@ export const extensionPreview = (fileName: string): AllowedPreviews => {
275265
return "pdf";
276266
}
277267

278-
if (textExtensions.includes(fileExtension)) {
279-
return "text";
280-
}
281-
282268
if (audioExtensions.includes(fileExtension)) {
283269
return "audio";
284270
}

0 commit comments

Comments
 (0)