Oops, fix loading state bug on homepage!
Right, when there are zero layers, we shouldn't say we're loading! This is a consequence of the HACK below. If we didn't short-circuit the effect when length == 0, then we would go through and successfully load 0 layers.
This commit is contained in:
parent
6652e66af1
commit
e2aeb90b4b
1 changed files with 1 additions and 1 deletions
|
@ -359,7 +359,7 @@ export function usePreloadLayers(layers) {
|
||||||
|
|
||||||
// NOTE: This condition would need to change if we started loading one at a
|
// NOTE: This condition would need to change if we started loading one at a
|
||||||
// time, or if the error case would need to show a partial state!
|
// time, or if the error case would need to show a partial state!
|
||||||
const loading = loadedLayers !== layers;
|
const loading = layers.length > 0 && loadedLayers !== layers;
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
// HACK: Don't clear the preview when we have zero layers, because it
|
// HACK: Don't clear the preview when we have zero layers, because it
|
||||||
|
|
Loading…
Reference in a new issue