検索内容の重複管理を実装
This commit is contained in:
parent
fbd76a0cf6
commit
fdd0c78adc
13
menu.js
13
menu.js
@ -42,7 +42,7 @@ export default function Menu(props) {
|
||||
const { scrollRef, mapHeight, MapFullHeight, mapMode, setMapMode } = props;
|
||||
const { navigate, addListener, isFocused } = useNavigation();
|
||||
const { favoriteStation } = useFavoriteStation();
|
||||
const { originalStationList,getStationDataFromNameBase } = useStationList();
|
||||
const { originalStationList, getStationDataFromNameBase } = useStationList();
|
||||
const { height, width } = useWindowDimensions();
|
||||
const { bottom, left, right, top } = useSafeAreaInsets();
|
||||
const tabBarHeight = useBottomTabBarHeight();
|
||||
@ -192,11 +192,16 @@ export default function Menu(props) {
|
||||
returnData.push([D]);
|
||||
});
|
||||
});
|
||||
if (JSON.stringify(returnData) == JSON.stringify(listUpStation)) return;
|
||||
}else{
|
||||
} else {
|
||||
const hoge = getStationDataFromNameBase(input);
|
||||
hoge.forEach(d=>returnData.push([d]));
|
||||
hoge.forEach((d, index, array) => {
|
||||
const stationName = d.Station_JP;
|
||||
if (returnData.findIndex((d1) => d1[0].Station_JP == stationName) != -1)
|
||||
return;
|
||||
returnData.push(array.filter((d2) => d2.Station_JP == stationName));
|
||||
});
|
||||
}
|
||||
if (JSON.stringify(returnData) == JSON.stringify(listUpStation)) return;
|
||||
setListUpStation(returnData);
|
||||
} else if (stationListMode == "position") {
|
||||
const returnData = nearPositionStation.filter((d) => d != undefined);
|
||||
|
Loading…
Reference in New Issue
Block a user