コード整理
This commit is contained in:
@@ -4,7 +4,25 @@ import {
|
||||
TextWidget,
|
||||
ListWidget,
|
||||
} from "react-native-android-widget";
|
||||
import dayjs from "dayjs";
|
||||
import { ToastAndroid } from "react-native";
|
||||
|
||||
export const getDelayData = async () => {
|
||||
// Fetch data from the server
|
||||
const time = dayjs().format("HH:mm");
|
||||
const delayString = await fetch(
|
||||
"https://script.google.com/macros/s/AKfycbyKxch7z7l8e07LXulRHqxjVoIiB13kcgvoToLE-rqlxLmLSKdlmqz0FI1F2EuA7Zfg/exec"
|
||||
)
|
||||
.then((response) => response.text())
|
||||
.then((data) => {
|
||||
if (data !== "") {
|
||||
return data.split("^");
|
||||
}
|
||||
return null;
|
||||
});
|
||||
ToastAndroid.show(`${delayString}`, ToastAndroid.SHORT);
|
||||
return { time, delayString };
|
||||
};
|
||||
export function TraInfoEXWidget({ time, delayString }) {
|
||||
return (
|
||||
<FlexWidget
|
||||
|
Reference in New Issue
Block a user