小修整
This commit is contained in:
parent
d6b701bdb1
commit
0d595c7f67
@ -50,7 +50,7 @@ export function MenuPage() {
|
||||
}, []);
|
||||
|
||||
const scrollRef = useRef(null);
|
||||
const [mapMode, setMapMode] = useState(false);
|
||||
const [mapMode, setMapMode] = useState(false);
|
||||
const [mapHeight, setMapHeight] = useState(0);
|
||||
useEffect(() => {
|
||||
const MapHeight =
|
||||
|
@ -132,7 +132,7 @@ export const EachData: FC<Props> = (props) => {
|
||||
setIsDepartureNow(false);
|
||||
setIsShow(true);
|
||||
}
|
||||
}, [d.time]);
|
||||
}, [d.time,currentTrainData]);
|
||||
useInterval(()=>{
|
||||
if (isDepartureNow) {
|
||||
setIsShow(!isShow);
|
||||
|
24
menu.js
24
menu.js
@ -34,13 +34,8 @@ configureReanimatedLogger({
|
||||
level: ReanimatedLogLevel.error, // Set the log level to error
|
||||
strict: true, // Reanimated runs in strict mode by default
|
||||
});
|
||||
export default function Menu({
|
||||
scrollRef,
|
||||
mapHeight,
|
||||
MapFullHeight,
|
||||
mapMode,
|
||||
setMapMode,
|
||||
}) {
|
||||
export default function Menu(props) {
|
||||
const { scrollRef, mapHeight, MapFullHeight, mapMode, setMapMode } = props;
|
||||
const { navigate, addListener, isFocused } = useNavigation();
|
||||
const { favoriteStation } = useFavoriteStation();
|
||||
const { originalStationList } = useStationList();
|
||||
@ -50,12 +45,12 @@ export default function Menu({
|
||||
const [stationListMode, setStationListMode] = useState(
|
||||
/*<"position"|"favorite">*/ "position"
|
||||
);
|
||||
useEffect(()=>{
|
||||
AS.getItem("stationListMode").then((res) => {
|
||||
setStationListMode(res);
|
||||
}).catch((e) => {
|
||||
// AS.setItem("stationListMode", "position");
|
||||
});
|
||||
useEffect(() => {
|
||||
AS.getItem("stationListMode")
|
||||
.then((res) => setStationListMode(res))
|
||||
.catch((e) => {
|
||||
// AS.setItem("stationListMode", "position");
|
||||
});
|
||||
}, []);
|
||||
const mapsRef = useRef(null);
|
||||
const returnToTop = (bool = true) => {
|
||||
@ -141,7 +136,8 @@ export default function Menu({
|
||||
let returnData = [];
|
||||
_stList.forEach((d, index, array) => {
|
||||
const stationName = d.Station_JP;
|
||||
if (returnData.findIndex((d) => d[0].Station_JP == stationName) != -1) return;
|
||||
if (returnData.findIndex((d) => d[0].Station_JP == stationName) != -1)
|
||||
return;
|
||||
returnData.push(array.filter((d2) => d2.Station_JP == stationName));
|
||||
});
|
||||
setNearPositionStation(returnData);
|
||||
|
Loading…
Reference in New Issue
Block a user