ウィジェットのバグを修正

This commit is contained in:
harukin-expo-dev-env 2024-05-24 03:11:26 +00:00
parent 0dad51cda2
commit 58dcc27704
3 changed files with 11 additions and 11 deletions

View File

@ -81,17 +81,15 @@ export function InfoWidget({ time, text }) {
}}
>
{text ? (
<FlexWidget
<TextWidget
style={{
flexDirection: "row",
width: "match_parent",
backgroundColor: "#ffffff",
flex: 1,
color: "#000000",
fontSize: 20,
}}
clickAction="WIDGET_CLICK"
>
<FlexText flex={3} text={text} />
</FlexWidget>
clickAction="OPEN_APP"
text={text}
/>
) : (
<TextWidget
style={{

View File

@ -33,7 +33,9 @@ export async function widgetTaskHandler(props) {
switch (WidgetName) {
case "Info_Widget": {
const { time, text } = await getInfoString();
renderWidget(<InfoWidget time={time} text={text} />);
renderWidget(
<InfoWidget time={time} text={text && text.toString()} />
);
break;
}
case "JR_shikoku_train_info":

View File

@ -34,7 +34,7 @@ export const WidgetSettings = ({ navigate }) => {
});
getInfoString().then(({ time, text }) => {
setTime(time);
setTrainInfo(text);
setTrainInfo(text.toString());
});
}, []);
return (