Commit 51b9fbd8 authored by haukao's avatar haukao
Browse files

Seems the bug was not fixed afterall... It is no

#14
parent 21602e66
......@@ -35,14 +35,8 @@ const randomRGB = (specification: Color = Color.RANDOM): string => {
const greenMult: number = specification === Color.GREEN ? 255 : 50;
const blueMult: number = specification === Color.BLUE ? 255 : 50;
const red: string = toPaddedHexString(Math.floor(Math.random() * redMult), 2);
const green: string = toPaddedHexString(
Math.floor(Math.random() * greenMult),
2
);
const blue: string = toPaddedHexString(
Math.floor(Math.random() * blueMult),
2
);
const green: string = toPaddedHexString(Math.floor(Math.random() * greenMult), 2);
const blue: string = toPaddedHexString(Math.floor(Math.random() * blueMult), 2);
return red + green + blue;
};
......
......@@ -33,7 +33,7 @@ const App: React.FC = () => {
const [loading, setLoading] = useState<boolean>(false);
const [favourites, setFavourites] = useState<number[]>([]);
const [theme, setTheme] = useState<number>(0);
const [userEdit, setUserEdit] = useState<boolean>(true)
const [userEdit, setUserEdit] = useState<boolean>(true);
const [errorDisplay, setErrorDisplay] = useState<boolean>(false);
const lsm: LocalStorageManager = new LocalStorageManager();
......@@ -79,7 +79,7 @@ const App: React.FC = () => {
setUserEdit(false);
};
/**
/**
* Temporary function as not all the animations are done
* @param specification - the color specification
*/
......@@ -89,7 +89,9 @@ const App: React.FC = () => {
if (index > 1) {
index = 1;
}
animate(index, specification);
if (userEdit || specification !== Color.RANDOM) {
animate(index, specification);
}
setUserEdit(false);
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment