リファクタリング
This commit is contained in:
parent
209568df4c
commit
dc089cf8f0
2
Apps.js
2
Apps.js
@ -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 },
|
||||
|
@ -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
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -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");
|
||||
}}
|
||||
|
Loading…
Reference in New Issue
Block a user