@skyvexsoftware/stratos-sdk 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -85,17 +85,19 @@ export function useTrackingSession() {
|
|
|
85
85
|
const recoverFlight = useCallback(async () => {
|
|
86
86
|
const result = await api("/recover", "POST");
|
|
87
87
|
if (result.success) {
|
|
88
|
-
|
|
88
|
+
// Refetch full state to ensure UI updates even if Socket.io
|
|
89
|
+
// broadcast was missed (e.g. socket not yet connected)
|
|
90
|
+
await refetch();
|
|
89
91
|
}
|
|
90
92
|
return result.success;
|
|
91
|
-
}, [
|
|
93
|
+
}, [refetch]);
|
|
92
94
|
const dismissRecovery = useCallback(async () => {
|
|
93
95
|
const result = await api("/dismiss-recovery", "POST");
|
|
94
96
|
if (result.success) {
|
|
95
|
-
|
|
97
|
+
await refetch();
|
|
96
98
|
}
|
|
97
99
|
return result.success;
|
|
98
|
-
}, [
|
|
100
|
+
}, [refetch]);
|
|
99
101
|
const flight = currentFlight;
|
|
100
102
|
const isActive = flight !== null &&
|
|
101
103
|
(flight.status === "active" || flight.status === "paused");
|