GithubCopilotによるリファクタリング
This commit is contained in:
parent
fdd0c78adc
commit
3ac0edd3ad
@ -84,11 +84,15 @@ export function MenuPage() {
|
|||||||
setFavoriteStation(returnData);
|
setFavoriteStation(returnData);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((d) => console.log(d));
|
.catch((error) => {
|
||||||
|
if (__DEV__) {
|
||||||
|
console.warn('お気に入り駅の読み込みに失敗しました:', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return unsubscribe;
|
return unsubscribe;
|
||||||
}, [navigation, mapHeight]);
|
}, [navigation, mapHeight, favoriteStation, setFavoriteStation]);
|
||||||
return (
|
return (
|
||||||
<Stack.Navigator>
|
<Stack.Navigator>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
|
@ -11,14 +11,8 @@ export const LongHeader = ({
|
|||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
//onTouchStart={() => setActionSheetHorizonalScroll(true)}
|
|
||||||
//onScrollEndDrag={() => setActionSheetHorizonalScroll(false)}
|
|
||||||
//onScrollBeginDrag={() => console.log("onScrollBeginDrag")}
|
|
||||||
style={{
|
style={{
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
//width: widthPercentageToDP("200%"),
|
|
||||||
// minHeight: 200,
|
|
||||||
//height: heightPercentageToDP("20%"),
|
|
||||||
}}
|
}}
|
||||||
horizontal
|
horizontal
|
||||||
pagingEnabled
|
pagingEnabled
|
||||||
|
@ -11,15 +11,9 @@ export const ShortHeader = ({
|
|||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
//onTouchStart={() => setActionSheetHorizonalScroll(true)}
|
|
||||||
//onScrollEndDrag={() => setActionSheetHorizonalScroll(false)}
|
|
||||||
//onScrollBeginDrag={() => console.log("onScrollBeginDrag")}
|
|
||||||
style={{
|
style={{
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
flex: 1,
|
flex: 1,
|
||||||
//width: widthPercentageToDP("200%"),
|
|
||||||
// minHeight: 200,
|
|
||||||
//height: heightPercentageToDP("20%"),
|
|
||||||
}}
|
}}
|
||||||
horizontal
|
horizontal
|
||||||
pagingEnabled
|
pagingEnabled
|
||||||
|
1
index.js
1
index.js
@ -1,4 +1,3 @@
|
|||||||
import 'babel-polyfill';
|
|
||||||
import { registerRootComponent } from "expo";
|
import { registerRootComponent } from "expo";
|
||||||
import { registerWidgetTaskHandler } from "react-native-android-widget";
|
import { registerWidgetTaskHandler } from "react-native-android-widget";
|
||||||
import { Platform } from "react-native";
|
import { Platform } from "react-native";
|
||||||
|
@ -46,6 +46,6 @@ export const findReversalPoints = (array, stopStationIDList) => {
|
|||||||
return allThroughStation;
|
return allThroughStation;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
// エラーが発生した場合は空の配列を返す
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -62,7 +62,7 @@ export const CurrentTrainProvider = ({ children }) => {
|
|||||||
setCurrentTrainLoading("success");
|
setCurrentTrainLoading("success");
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
console.log("えらー");
|
// エラー時の処理
|
||||||
setCurrentTrainLoading("error");
|
setCurrentTrainLoading("error");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -42,7 +42,12 @@ export const FavoriteStationProvider:FC<Props> = ({ children }) => {
|
|||||||
const returnData = JSON.parse(d);
|
const returnData = JSON.parse(d);
|
||||||
setFavoriteStation(returnData);
|
setFavoriteStation(returnData);
|
||||||
})
|
})
|
||||||
.catch((d) => console.log(d));
|
.catch((error) => {
|
||||||
|
// エラーログを記録(開発時のみ)
|
||||||
|
if (__DEV__) {
|
||||||
|
console.warn('お気に入り駅の読み込みに失敗しました:', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
return (
|
return (
|
||||||
<FavoriteStationContext.Provider
|
<FavoriteStationContext.Provider
|
||||||
|
@ -26,7 +26,7 @@ Notifications.setNotificationHandler({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function handleRegistrationError(errorMessage: string) {
|
function handleRegistrationError(errorMessage: string) {
|
||||||
console.log(errorMessage);
|
// エラーを適切に処理(必要に応じてユーザーに通知)
|
||||||
//throw new Error(errorMessage);
|
//throw new Error(errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"@/*": ["./*"] //追加
|
"@/*": ["./*"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./*"] //修正
|
"@/*": ["./*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"extends": "expo/tsconfig.base"
|
"extends": "expo/tsconfig.base"
|
||||||
|
Loading…
Reference in New Issue
Block a user