Fixed: Ensure loading message doesn't change on re-render

pull/6/head
Qstick 6 years ago
parent 3e3c644cbb
commit 117a3970e8

@ -22,9 +22,13 @@ const messages = [
'Loading Battlestation' 'Loading Battlestation'
]; ];
let message = null;
function LoadingMessage() { function LoadingMessage() {
const index = Math.floor(Math.random() * messages.length); if (!message) {
const message = messages[index]; const index = Math.floor(Math.random() * messages.length);
message = messages[index];
}
return ( return (
<div className={styles.loadingMessage}> <div className={styles.loadingMessage}>

Loading…
Cancel
Save