Fix JSON error when no custom question set
This commit is contained in:
parent
4338b11939
commit
87b7d9e246
2 changed files with 2 additions and 2 deletions
|
@ -56,7 +56,7 @@ export default function GameRoom({ params }: roomProps) {
|
||||||
const localBrowserId = localStorage.getItem("browserId")
|
const localBrowserId = localStorage.getItem("browserId")
|
||||||
setBrowserId(localBrowserId)
|
setBrowserId(localBrowserId)
|
||||||
const localCustomQuestionsString = localStorage.getItem("customQuestions")
|
const localCustomQuestionsString = localStorage.getItem("customQuestions")
|
||||||
const localCustomQuestions = JSON.parse(localCustomQuestionsString != null ? localCustomQuestionsString : "")
|
const localCustomQuestions = JSON.parse(localCustomQuestionsString != null ? localCustomQuestionsString : "{}")
|
||||||
setCustomQuestions(localCustomQuestions == null ? [] : localCustomQuestions)
|
setCustomQuestions(localCustomQuestions == null ? [] : localCustomQuestions)
|
||||||
|
|
||||||
// Listen for incoming setMessages
|
// Listen for incoming setMessages
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "node server.mjs",
|
"dev": "node server.mjs",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "NODE_ENV='production' && node server.mjs",
|
"start": "NODE_ENV=production && node server.mjs",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
"websocket": "node server.mjs"
|
"websocket": "node server.mjs"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue