From ec7ad080ff58a5b16c2c0f85352628556a897b11 Mon Sep 17 00:00:00 2001 From: Denis Thiessen Date: Mon, 27 May 2024 16:51:25 +0200 Subject: [PATCH] fix: Added explaining comments. --- src/components/RandomIDComponent.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/RandomIDComponent.jsx b/src/components/RandomIDComponent.jsx index f865024..b23ff75 100644 --- a/src/components/RandomIDComponent.jsx +++ b/src/components/RandomIDComponent.jsx @@ -5,6 +5,7 @@ import { getTranslation } from "../core/i18n/I18NHandler"; var randomId = 0; +// State for saving participant ID globally. export const participantIdLogState = createStore( persist( () => ({ @@ -19,6 +20,7 @@ export const participantIdLogState = createStore( const { getState, setState } = participantIdLogState; +// Can only be called once. :) function RandomIDComponent() { randomId = Math.floor(Math.random() * 89999) + 10000; setState({ participant_id: "" + randomId })