From 170bc36afa0fb9a6e9eecd6ec74fec337067dc2e Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Tue, 21 May 2024 10:19:09 +0000 Subject: [PATCH] =?UTF-8?q?props=E7=B5=B1=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AndroidWidget/widget-task-handler.jsx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/components/AndroidWidget/widget-task-handler.jsx b/components/AndroidWidget/widget-task-handler.jsx index d6b811d..7878f6f 100644 --- a/components/AndroidWidget/widget-task-handler.jsx +++ b/components/AndroidWidget/widget-task-handler.jsx @@ -44,33 +44,38 @@ export const getDelayData = async () => { return { time, delayString }; }; export async function widgetTaskHandler(props) { + const { + widgetInfo, + widgetAction, + renderWidget, + clickAction, + clickActionData, + } = props; const WidgetName = await AS.getItem( - `widgetType/${props.widgetInfo.widgetId}` + `widgetType/${widgetInfo.widgetId}` ).catch((e) => "JR_shikoku_train_info"); ToastAndroid.show( - `Widget Action: ${JSON.stringify(props.widgetInfo.widgetId)}`, + `Widget Action: ${JSON.stringify(widgetInfo.widgetId)}`, ToastAndroid.SHORT ); ToastAndroid.show(`Widget Name: ${WidgetName}`, ToastAndroid.SHORT); - switch (props.widgetAction) { + switch (widgetAction) { case "WIDGET_ADDED": case "WIDGET_UPDATE": case "WIDGET_CLICK": case "WIDGET_RESIZED": if (WidgetName === "JR_shikoku_train_info") { const { time, delayString } = await getDelayData(); - props.renderWidget( - - ); + renderWidget(); } else if (WidgetName === "Info_Widget") { const { time, text } = await getInfoString(); - props.renderWidget(); + renderWidget(); } break; case "WIDGET_DELETED": - AS.removeItem(`widgetType/${props.widgetInfo.widgetId}`); + AS.removeItem(`widgetType/${widgetInfo.widgetId}`); break; default: break;