my-fleetbo-react-v1 1.0.8 → 1.0.10
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.
package/package.json
CHANGED
|
@@ -61,7 +61,6 @@ export const useStartupEffect = () => {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
|
|
65
64
|
if (window.Fleetbo && typeof window.Fleetbo.fleetboLog === 'function') {
|
|
66
65
|
if (window.Fleetbo) onFleetboReady();
|
|
67
66
|
else requester = setInterval(() => { if (window.Fleetbo) onFleetboReady(); }, 100);
|
|
@@ -75,27 +74,17 @@ export const useStartupEffect = () => {
|
|
|
75
74
|
}, 500);
|
|
76
75
|
}
|
|
77
76
|
else {
|
|
78
|
-
// Sentinelle de sécurité active pour le mode Standalone Web App
|
|
79
77
|
setTimeout(() => {
|
|
80
|
-
if (!isReadyRef.current)
|
|
81
|
-
setError("Running outside of Fleetbo Environment.");
|
|
82
|
-
|
|
83
|
-
// ⚡ COUPE-CIRCUIT : On désamorce le timeout de 15s immédiatement
|
|
84
|
-
if (timer) clearTimeout(timer);
|
|
85
|
-
}
|
|
78
|
+
if (!isReadyRef.current) setError("Running outside of Fleetbo Environment.");
|
|
86
79
|
}, 2000);
|
|
87
80
|
}
|
|
88
|
-
|
|
89
81
|
timer = setTimeout(() => {
|
|
90
82
|
if (!isReadyRef.current) {
|
|
91
83
|
setError("Connection Timeout.");
|
|
92
84
|
cleanup();
|
|
93
85
|
}
|
|
94
86
|
}, 15000);
|
|
95
|
-
|
|
96
|
-
window.navigateToTab = (route) => navigate(route);
|
|
97
|
-
|
|
98
|
-
// Listener logout
|
|
87
|
+
window.navigateToTab = (route) => navigate(route);
|
|
99
88
|
const handleLogout = (event) => {
|
|
100
89
|
if (event.data?.type === 'FLEETBO_FORCE_LOGOUT') {
|
|
101
90
|
setIsAuthenticated(false);
|
|
@@ -108,7 +97,6 @@ export const useStartupEffect = () => {
|
|
|
108
97
|
|
|
109
98
|
return () => {
|
|
110
99
|
cleanup();
|
|
111
|
-
// Clear listener
|
|
112
100
|
window.removeEventListener('message', handleLogout);
|
|
113
101
|
};
|
|
114
102
|
}, [navigate]);
|
|
@@ -54,7 +54,7 @@ export default function SampleTab3() {
|
|
|
54
54
|
onTouchEnd={(e) => e.currentTarget.style.transform = 'scale(1)'}
|
|
55
55
|
onMouseDown={(e) => e.currentTarget.style.transform = 'scale(0.96)'}
|
|
56
56
|
onMouseUp={(e) => e.currentTarget.style.transform = 'scale(1)'}
|
|
57
|
-
onClick={() => Fleetbo.emit('
|
|
57
|
+
onClick={() => Fleetbo.emit('CONFIRM_LOGOUT', {})}
|
|
58
58
|
>
|
|
59
59
|
Log Out
|
|
60
60
|
</div>
|
|
@@ -8,7 +8,7 @@ export default function Tab3() {
|
|
|
8
8
|
emit: async (action, payload) => {
|
|
9
9
|
if (action === 'HIDE_NAVBAR') setNavMode("none");
|
|
10
10
|
if (action === 'SHOW_NAVBAR') setNavMode("show");
|
|
11
|
-
if (action === '
|
|
11
|
+
if (action === 'CONFIRM_LOGOUT') { Fleetbo.logout(); }
|
|
12
12
|
//if (action === 'OPEN_EDIT_PROFILE') {
|
|
13
13
|
// Example: Fleetbo.exec('EditProfileModule', 'open', {});
|
|
14
14
|
//}
|