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

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 ? ( {text ? (
<FlexWidget <TextWidget
style={{ style={{
flexDirection: "row", color: "#000000",
width: "match_parent",
backgroundColor: "#ffffff", fontSize: 20,
flex: 1,
}} }}
clickAction="WIDGET_CLICK" clickAction="OPEN_APP"
> text={text}
<FlexText flex={3} text={text} /> />
</FlexWidget>
) : ( ) : (
<TextWidget <TextWidget
style={{ style={{

View File

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

View File

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