From 117a3970e8d0fafed5f2238429583e0ec7e59344 Mon Sep 17 00:00:00 2001 From: Qstick Date: Thu, 11 Apr 2019 21:52:05 -0400 Subject: [PATCH] Fixed: Ensure loading message doesn't change on re-render --- frontend/src/Components/Loading/LoadingMessage.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/Components/Loading/LoadingMessage.js b/frontend/src/Components/Loading/LoadingMessage.js index 1f7515ca7..a4ca95beb 100644 --- a/frontend/src/Components/Loading/LoadingMessage.js +++ b/frontend/src/Components/Loading/LoadingMessage.js @@ -22,9 +22,13 @@ const messages = [ 'Loading Battlestation' ]; +let message = null; + function LoadingMessage() { - const index = Math.floor(Math.random() * messages.length); - const message = messages[index]; + if (!message) { + const index = Math.floor(Math.random() * messages.length); + message = messages[index]; + } return (