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

* fix(randomiseFileNames): work correctly on web

* fix the fix
main
ActuallyTheSun 2 years ago committed by GitHub
parent e1027e06c1
commit c5e0c7a6e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save