Add SmartTaskInput with Custom Renderer.

Change to use `@tanstack/react-query`
Add Global ErrorProvider
Add limited Support for offline version
Fix issue with calendar display +1 day
This commit is contained in:
Mo Tarbin
2025-04-24 01:03:40 -04:00
parent 4f1715913e
commit f0e0c0e4fc
34 changed files with 1943 additions and 1302 deletions

View File

@@ -1,5 +1,5 @@
import { Network } from '@capacitor/network'
// import { localStore } from '../utils/LocalStore'
import { localStore } from '../utils/LocalStore'
import { syncManager } from '../utils/SyncManager.jsx' // Ensure you import syncManager if needed for syncing
class NetworkManager {
constructor() {
@@ -23,29 +23,33 @@ class NetworkManager {
this.isOnline = status.connected
}
})
const syncQueue = () => {
localStore
.syncQueuedRequests()
.then(hasMessages => {
console.log(
'Queued requests synced successfully. Queue has messaage is: ',
hasMessages,
)
if (hasMessages) {
this.notifyBackendSync()
}
})
.catch(error => {
console.error('Error syncing queued requests:', error)
})
}
this.registerNetworkListener(async isOnline => {
if (isOnline && this.isNetworkOn) {
// TODO: Delete when Sync manager Implemented
// localStore
// .syncQueuedRequests()
// .then(hasMessages => {
// console.log(
// 'Queued requests synced successfully. Queue has messaage is: ',
// hasMessages,
// )
// if (hasMessages) {
// this.notifyBackendSync()
// }
// })
// .catch(error => {
// console.error('Error syncing queued requests:', error)
// })
syncQueue()
console.log('NetworkManager: Network is back online. with SYNCMANAGER')
await syncManager.syncTasks()
console.log('Finished syncing queued requests.')
}
})
syncQueue()
}
setOffline() {