aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorActuallyTheSun <78964224+ActuallyTheSun@users.noreply.github.com>2022-10-04 22:46:08 +0300
committerGitHub <noreply@github.com>2022-10-04 21:46:08 +0200
commitc5e0c7a6e72d68b9479c163ac446bb905bdf12a5 (patch)
treeb6205399195dea7853a8898c90d8f587b20d4fbb
parente1027e06c152f8b9668a3099db0f110e280991fd (diff)
downloadVencord-c5e0c7a6e72d68b9479c163ac446bb905bdf12a5.tar.gz
Vencord-c5e0c7a6e72d68b9479c163ac446bb905bdf12a5.tar.bz2
Vencord-c5e0c7a6e72d68b9479c163ac446bb905bdf12a5.zip
fix(randomiseFileNames): work correctly on web (#40)
* fix(randomiseFileNames): work correctly on web * fix the fix
-rw-r--r--src/plugins/randomiseFileNames.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/randomiseFileNames.ts b/src/plugins/randomiseFileNames.ts
index eeaef3a..3826711 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(".")) : "")
},
});