mirror of
https://github.com/Stef-00012/Zipline-Android-App.git
synced 2025-05-11 18:35:58 +02:00
[nobuild] fix original name not working, partially finish full screen file display
This commit is contained in:
parent
604301fcbf
commit
2fcca6686e
16 changed files with 490 additions and 143 deletions
|
@ -1,5 +1,7 @@
|
|||
import mimetypesJSON from "@/assets/mimetypes.json";
|
||||
import type { Mimetypes } from "@/types/mimetypes";
|
||||
import bytes from "bytes";
|
||||
import ms, { type FormatOptions } from "enhanced-ms";
|
||||
import * as FileSystem from "expo-file-system";
|
||||
|
||||
const mimetypes = mimetypesJSON as Mimetypes;
|
||||
|
@ -96,4 +98,26 @@ export function colorHash(str: string) {
|
|||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
export function convertToBytes(value: string | number, options?: bytes.BytesOptions): string | null {
|
||||
if (typeof value === "number") return bytes(value, options);
|
||||
|
||||
if (/^\d+(\.\d+)?$/.test(value)) {
|
||||
return bytes(Number.parseFloat(value),options);
|
||||
}
|
||||
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
export function convertToTime(value: string | number, options?: FormatOptions): string | null {
|
||||
if (typeof value === "number") return ms(value);
|
||||
|
||||
if (/^\d+(\.\d+)?$/.test(value)) {
|
||||
return ms(Number.parseFloat(value), options);
|
||||
}
|
||||
|
||||
|
||||
return value;
|
||||
}
|
|
@ -55,8 +55,6 @@ export async function createUserExport(): Promise<{ running: boolean } | string>
|
|||
statusCode: number;
|
||||
} | undefined;
|
||||
|
||||
console.log(data)
|
||||
|
||||
if (data) return data.error
|
||||
|
||||
return "Something went wrong..."
|
||||
|
|
|
@ -191,11 +191,6 @@ export async function editUser(
|
|||
},
|
||||
});
|
||||
|
||||
console.debug({
|
||||
options,
|
||||
data: res.data
|
||||
})
|
||||
|
||||
return res.data;
|
||||
} catch (e) {
|
||||
const error = e as AxiosError;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue