Phase 2 refinements: Firebase config, dev environment fixes, phase 3 requirement draft
- Integrated Firebase SDK in both Flutter apps (google-services, firebase_options) - Fixed auth flow, API client, and pairing/status blocs for dev environment - Added full Flutter project scaffolds (android, ios, web, etc.) - Added phase 3 chat engine requirement document - Added bugreport zip pattern to gitignore Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -95,17 +95,16 @@ class StatusBloc extends Bloc<StatusEvent, StatusState> {
|
||||
}
|
||||
|
||||
Future<void> _onAppPaused(AppPaused event, Emitter<StatusState> emit) async {
|
||||
if (state is StatusLoaded && (state as StatusLoaded).isOnline) {
|
||||
try {
|
||||
await apiClient.post('/api/mitra/status/offline');
|
||||
} catch (_) {}
|
||||
_stopHeartbeat();
|
||||
emit(StatusLoaded(isOnline: false));
|
||||
}
|
||||
// Don't auto-offline on pause — heartbeat timeout (45s) handles truly offline mitras.
|
||||
// This allows mitra to stay online when briefly switching apps.
|
||||
_stopHeartbeat();
|
||||
}
|
||||
|
||||
Future<void> _onAppResumed(AppResumed event, Emitter<StatusState> emit) async {
|
||||
// Do NOT auto-set online on resume; mitra must explicitly toggle
|
||||
// Resume heartbeat if mitra was online
|
||||
if (state is StatusLoaded && (state as StatusLoaded).isOnline) {
|
||||
_startHeartbeat();
|
||||
}
|
||||
add(StatusLoadRequested());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user