From c5e0c7a6e72d68b9479c163ac446bb905bdf12a5 Mon Sep 17 00:00:00 2001 From: ActuallyTheSun <78964224+ActuallyTheSun@users.noreply.github.com> Date: Tue, 4 Oct 2022 22:46:08 +0300 Subject: [PATCH] fix(randomiseFileNames): work correctly on web (#40) * fix(randomiseFileNames): work correctly on web * fix the fix --- src/plugins/randomiseFileNames.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/randomiseFileNames.ts b/src/plugins/randomiseFileNames.ts index eeaef3a36..3826711db 100644 --- a/src/plugins/randomiseFileNames.ts +++ b/src/plugins/randomiseFileNames.ts @@ -23,6 +23,6 @@ export default definePlugin({ { length: 7 }, () => chars[Math.floor(Math.random() * chars.length)] ).join(""); - return rand + window.DiscordNative.fileManager.extname(file); + return rand + (file.lastIndexOf(".") > -1 ? file.slice(file.lastIndexOf(".")) : "") }, });