mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
mobile: fix attachment downloads failing on mobile
This commit is contained in:
@@ -23,11 +23,11 @@ export async function getFileNameWithExtension(
|
||||
): Promise<string> {
|
||||
if (!mime || mime === "application/octet-stream") return filename;
|
||||
|
||||
const { default: mimeDB } = await import("mime");
|
||||
const { default: mimeDB } = await import("mime-db");
|
||||
|
||||
const extensions = mimeDB.getAllExtensions(mime);
|
||||
const { extensions } = mimeDB[mime] || {};
|
||||
|
||||
if (!extensions || extensions.size === 0) return filename;
|
||||
if (!extensions || extensions.length === 0) return filename;
|
||||
|
||||
for (const ext of extensions) {
|
||||
if (filename.endsWith(ext)) return filename;
|
||||
|
||||
Reference in New Issue
Block a user