Skip to content

Commit

Permalink
🔧 (cast): Replace UUID with nanoid
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Apr 22, 2023
1 parent 0c4ad99 commit bd32fc0
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
47 changes: 39 additions & 8 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"file-saver": "2.0.5",
"fuse.js": "6.6.2",
"howler": "2.2.3",
"nanoid": "4.0.2",
"pocketbase": "0.14.0",
"register-service-worker": "1.7.2",
"sass": "1.62.0",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/util/Preset.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import base64 from "base64-url";
import { nanoid } from "nanoid";
import { Filetype } from "./filetype";
import { getSounds } from "../data/sounds";

Expand Down Expand Up @@ -47,7 +48,7 @@ export class Preset {
mixUrlAs(filetype = Filetype.Mp3) {
let uuid = sessionStorage.getItem("uuid");
if (!uuid) {
uuid = crypto.randomUUID();
uuid = nanoid();
sessionStorage.setItem("uuid", uuid);
}
return `${window.location.origin}/api/mix/${uuid}/${this.encodedShorthand}.${filetype}`;
Expand Down

0 comments on commit bd32fc0

Please sign in to comment.