|
@@ -10,7 +10,7 @@ export default function useScreen(cityId, person) {
|
10
|
10
|
const dispatch = useDispatch()
|
11
|
11
|
|
12
|
12
|
const [firstScreen, setFirstScreen] = useState()
|
13
|
|
- const canShow = useSelector(s => !s.system.firstScreen.filter(x => x === cityId)[0])
|
|
13
|
+ const cityShow = useSelector(s => s.system.firstScreen.filter(x => x.cityId === cityId)[0])
|
14
|
14
|
const toggle = useCallback(
|
15
|
15
|
() => dispatch({ type: 'TOGGLE_FIRSTSCREEN', payload: { cityId } }),
|
16
|
16
|
[cityId, dispatch],
|
|
@@ -29,7 +29,5 @@ export default function useScreen(cityId, person) {
|
29
|
29
|
}
|
30
|
30
|
}, [cityId, toggle, person?.personId])
|
31
|
31
|
|
32
|
|
- const show = canShow && firstScreen
|
33
|
|
-
|
34
|
|
- return [firstScreen, show, toggle]
|
|
32
|
+ return [firstScreen, cityShow?.visible, toggle]
|
35
|
33
|
}
|