feat(localization): Add en/vi language
This commit is contained in:
@@ -12,12 +12,12 @@ export default function useGetGpsModel() {
|
||||
try {
|
||||
// Bypass cache để GPS luôn realtime, gọi trực tiếp API
|
||||
const data = await getGPS();
|
||||
console.log('GPS fetched from API:', data);
|
||||
// console.log('GPS fetched from API:', data);
|
||||
|
||||
setGpsData(data);
|
||||
// Luôn emit event GPS để đảm bảo realtime
|
||||
try {
|
||||
eventBus.emit('gpsData:update', data);
|
||||
// eventBus.emit('gpsData:update', data);
|
||||
} catch (e) {
|
||||
console.warn('Failed to emit gpsData:update event', e);
|
||||
}
|
||||
@@ -31,7 +31,7 @@ export default function useGetGpsModel() {
|
||||
// ✅ Lắng nghe event cập nhật cache từ nơi khác (nếu có)
|
||||
useEffect(() => {
|
||||
const handleUpdate = (data: API.GPSResonse) => {
|
||||
console.log('GPS cache updated via eventBus');
|
||||
// console.log('GPS cache updated via eventBus');
|
||||
setGpsData(data);
|
||||
};
|
||||
eventBus.on('gpsData:update', handleUpdate);
|
||||
|
||||
Reference in New Issue
Block a user