宇多津に近づいたらクラッシュする問題、現在地のリストアップ機能がちゃんと整理されていなかった問題を修正
This commit is contained in:
parent
a0f1c64041
commit
c41c61bba7
@ -128,7 +128,10 @@ export const EachData: FC<Props> = (props) => {
|
||||
const diff = trainTime.diff(currentTime, "minute");
|
||||
if (diff < 2) setIsDepartureNow(true);
|
||||
else setIsDepartureNow(false);
|
||||
})
|
||||
return()=>{
|
||||
setIsDepartureNow(false);
|
||||
}
|
||||
}, [d.time]);
|
||||
useInterval(()=>{
|
||||
if (isDepartureNow) {
|
||||
setIsShow(!isShow);
|
||||
@ -182,7 +185,7 @@ export const EachData: FC<Props> = (props) => {
|
||||
<StatusAndDelay trainDelayStatus={trainDelayStatus} />
|
||||
</TouchableOpacity>
|
||||
{!!isDepartureNow && (
|
||||
<Description info={d.lastStation == "当駅止" ? "この列車は当駅止です。間もなく到着します。":"この列車は間もなく発車します。"} key={d.train + "-description"} />
|
||||
<Description info={d.lastStation == "当駅止" ? "この列車は当駅止です。間もなく到着します。":"列車の出発時刻です。"} key={d.train + "-description"} />
|
||||
)}
|
||||
{trainDescriptionSwitch && (
|
||||
<TrainPosition
|
||||
|
25
menu.js
25
menu.js
@ -33,7 +33,13 @@ 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({
|
||||
scrollRef,
|
||||
mapHeight,
|
||||
MapFullHeight,
|
||||
mapMode,
|
||||
setMapMode,
|
||||
}) {
|
||||
const { navigate, addListener, isFocused } = useNavigation();
|
||||
const { favoriteStation } = useFavoriteStation();
|
||||
const { originalStationList } = useStationList();
|
||||
@ -115,15 +121,24 @@ export default function Menu({ scrollRef, mapHeight, MapFullHeight, mapMode, set
|
||||
return NearStation;
|
||||
};
|
||||
|
||||
let returnDataBase = lineList
|
||||
let _stList = lineList
|
||||
.map((d) => findStationEachLine(originalStationList[d]))
|
||||
.filter((d) => d.length > 0)
|
||||
.reduce((pre, current) => {
|
||||
pre.push(...current);
|
||||
return pre;
|
||||
}, [])
|
||||
.map((d) => [d]);
|
||||
setNearPositionStation(returnDataBase.length ? returnDataBase : []);
|
||||
}, []);
|
||||
if (_stList.length == 0) setNearPositionStation([]);
|
||||
else {
|
||||
let returnData = [];
|
||||
_stList.forEach((d, index, array) => {
|
||||
const stationName = d.Station_JP;
|
||||
if (returnData.findIndex((d) => d[0].Station_JP == stationName) != -1) return;
|
||||
returnData.push(array.filter((d2) => d2.Station_JP == stationName));
|
||||
});
|
||||
returnData.forEach((d) => console.log(d));
|
||||
setNearPositionStation(returnData);
|
||||
}
|
||||
};
|
||||
|
||||
const [nearPositionStation, setNearPositionStation] = useState([]); //第三要素
|
||||
|
Loading…
Reference in New Issue
Block a user