diff options
author | ActuallyTheSun <78964224+ActuallyTheSun@users.noreply.github.com> | 2022-10-04 22:46:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 21:46:08 +0200 |
commit | c5e0c7a6e72d68b9479c163ac446bb905bdf12a5 (patch) | |
tree | b6205399195dea7853a8898c90d8f587b20d4fbb | |
parent | e1027e06c152f8b9668a3099db0f110e280991fd (diff) | |
download | Vencord-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.ts | 2 |
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(".")) : "") }, }); |