Skip to content

Commit

Permalink
use number for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
fachrihawari committed Nov 5, 2024
1 parent 43c7fd1 commit 8387d0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function sendEvent<T extends keyof EventMap>(name: T, data: EventMa
}

export async function createRoom() {
const code = nanoid(8)
const code = nanoid()
cookies().set('host', code, cookieOpts)
redirect(`/${code}`)
}
Expand Down
4 changes: 2 additions & 2 deletions lib/nanoid.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { customAlphabet } from 'nanoid'

const nanoid = customAlphabet('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ', 16)
const nanoid = customAlphabet('1234567890', 6)

export default nanoid
export default nanoid

0 comments on commit 8387d0c

Please sign in to comment.