1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-23 00:07:07 +00:00

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

This commit is contained in:
Mark McDowall 2019-04-06 19:22:24 -07:00
parent e325a5c27e
commit f748891b4b

View file

@ -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}>