リファクタリング

This commit is contained in:
harukin-DeskMini 2022-09-28 19:13:10 +09:00
parent 209568df4c
commit dc089cf8f0
3 changed files with 11 additions and 21 deletions

View File

@ -13,8 +13,6 @@ import AsyncStorage from "@react-native-async-storage/async-storage";
import StatusbarDetect from './StatusbarDetect';
var Status = StatusbarDetect(); */
export var webview = null;
export default function Apps(props) {
const {
navigation: { navigate },

View File

@ -1,19 +1,18 @@
import { ToastAndroid } from "react-native";
import * as Updates from "expo-updates";
export function UpdateAsync() {
export const UpdateAsync = () =>
Updates.checkForUpdateAsync()
.then((update) => {
if (update.isAvailable) {
ToastAndroid.showWithGravityAndOffset(
"アプリのデータを更新しています。",
ToastAndroid.LONG,
ToastAndroid.BOTTOM,
25,
50
);
Updates.fetchUpdateAsync().then(() => Updates.reloadAsync());
}
if (!update.isAvailable) return;
ToastAndroid.showWithGravityAndOffset(
"アプリのデータを更新しています。",
ToastAndroid.LONG,
ToastAndroid.BOTTOM,
25,
50
);
Updates.fetchUpdateAsync().then(() => Updates.reloadAsync());
})
.catch((e) =>
ToastAndroid.showWithGravityAndOffset(
@ -24,4 +23,3 @@ export function UpdateAsync() {
50
)
);
}

View File

@ -55,13 +55,7 @@ export default function trainMenu({
}}
onPress={() => {
webview.current?.injectJavaScript(
"MoveDisplayStation('" +
d +
"_" +
D.MyStation +
"_" +
D.Station_JP +
"')"
`MoveDisplayStation('${d}_${D.MyStation}_${D.Station_JP}')`
);
navigate("Apps");
}}