aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2023-09-21 13:24:03 -0400
committerSophie Zhang <sophie_zhang@brown.edu>2023-09-21 13:24:03 -0400
commit0d6c1aa1869963e548374c634a65b27f0ea32de9 (patch)
tree7bb317d08f9afa2e96caf0a48f65cbba8c220151 /src
parent013f25f01e729feee5db94900c61f4be4dd46869 (diff)
fix non-image (video still broken)
Diffstat (limited to 'src')
-rw-r--r--src/client/util/reportManager/reportManagerUtils.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/util/reportManager/reportManagerUtils.ts b/src/client/util/reportManager/reportManagerUtils.ts
index 1bbb60f7a..948229442 100644
--- a/src/client/util/reportManager/reportManagerUtils.ts
+++ b/src/client/util/reportManager/reportManagerUtils.ts
@@ -89,7 +89,13 @@ export const fileLinktoServerLink = (fileLink: string): string => {
const regex = 'public';
const publicIndex = fileLink.indexOf(regex) + regex.length;
- const finalUrl = `${serverUrl}${fileLink.substring(publicIndex + 1).replace('.', '_l.')}`;
+ let finalUrl: string = '';
+ if (fileLink.includes('.png') || fileLink.includes('.jpg') || fileLink.includes('.jpeg') || fileLink.includes('.gif')) {
+ finalUrl = `${serverUrl}${fileLink.substring(publicIndex + 1).replace('.', '_l.')}`;
+ } else {
+ finalUrl = `${serverUrl}${fileLink.substring(publicIndex + 1)}`;
+ }
+
return finalUrl;
};
@@ -108,6 +114,7 @@ export const getServerPath = (link: any): string => {
* @returns the server paths or undefined on error
*/
export const uploadFilesToServer = async (mediaFiles: FileData[]): Promise<string[] | undefined> => {
+ console.log(mediaFiles);
try {
// need to always upload to browndash
const links = await Networking.UploadFilesToServer(mediaFiles.map(file => ({ file: file.file })));