refactor(useOfflineBookingCachePolling): 使用 normalize_options 显式处理轮询选项
确保网络监听器中传入的轮询选项经过规范化处理,避免潜在的 null/undefined 问题
Showing
1 changed file
with
5 additions
and
1 deletions
| ... | @@ -161,7 +161,11 @@ const ensure_network_listener = async () => { | ... | @@ -161,7 +161,11 @@ const ensure_network_listener = async () => { |
| 161 | // 网络恢复时,确保轮询正在运行(处理之前因网络不可用而可能停止的轮询) | 161 | // 网络恢复时,确保轮询正在运行(处理之前因网络不可用而可能停止的轮询) |
| 162 | if (polling_state.network_usable && should_run_polling()) { | 162 | if (polling_state.network_usable && should_run_polling()) { |
| 163 | // 传入 restart: true,支持重启逻辑 | 163 | // 传入 restart: true,支持重启逻辑 |
| 164 | - start_offline_booking_cache_polling({ ...(polling_state.last_options || {}), restart: true }) | 164 | + // 使用 normalize_options 显式处理 null/undefined,语义更清晰 |
| 165 | + start_offline_booking_cache_polling({ | ||
| 166 | + ...normalize_options(polling_state.last_options), | ||
| 167 | + restart: true | ||
| 168 | + }) | ||
| 165 | } | 169 | } |
| 166 | } | 170 | } |
| 167 | 171 | ... | ... |
-
Please register or login to post a comment