fix(randomiseFileNames): work correctly on web (#40)

* fix(randomiseFileNames): work correctly on web

* fix the fix
This commit is contained in:
ActuallyTheSun 2022-10-04 22:46:08 +03:00 committed by GitHub
parent e1027e06c1
commit c5e0c7a6e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(".")) : "")
},
});