From 684e1930495a9aef4e334d0a07e3e29abc15610e Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Wed, 11 Sep 2019 17:50:32 +0200 Subject: [PATCH] Fixing possible to large index --- src/stores.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores.ts b/src/stores.ts index 7143cba..bab7dad 100644 --- a/src/stores.ts +++ b/src/stores.ts @@ -47,7 +47,7 @@ class QuestionManager { if (options.length <= 0) options = this.availableQuestions; - let idx = Math.floor(Math.random() * options.length); + let idx = Math.random() * options.length; let randomItem = options[idx]; console.log("Setting question", randomItem); this.activeQuestion.set({