mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-09 18:22:48 +10:00
feat: Enhance companion connection features and UI updates
- Added functionality to load and restore the last companion's scope on app startup. - Implemented caching mechanisms for contacts, channels, and messages related to the current companion. - Updated UI to reflect connection status, including disabling message input when disconnected. - Introduced new dialog prompts to inform users when they need to connect to a companion for accessing features. - Refactored navigation logic to improve user experience when disconnected, directing users to the scanner screen. - Added localization strings for new companion connection prompts in multiple languages.
This commit is contained in:
+4
-9
@@ -5,10 +5,10 @@ import 'l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'screens/chrome_required_screen.dart';
|
||||
import 'screens/contacts_screen.dart';
|
||||
import 'utils/platform_info.dart';
|
||||
|
||||
import 'connector/meshcore_connector.dart';
|
||||
import 'screens/scanner_screen.dart';
|
||||
import 'services/storage_service.dart';
|
||||
import 'services/message_retry_service.dart';
|
||||
import 'services/path_history_service.dart';
|
||||
@@ -81,13 +81,8 @@ void main() async {
|
||||
timeoutPredictionService: timeoutPredictionService,
|
||||
);
|
||||
|
||||
await connector.loadContactCache();
|
||||
await connector.loadChannelSettings();
|
||||
await connector.loadCachedChannels();
|
||||
|
||||
// Load persisted channel messages
|
||||
await connector.loadAllChannelMessages();
|
||||
await connector.loadUnreadState();
|
||||
await connector.restoreLastCompanionScope();
|
||||
await connector.loadAllCachedDataForCurrentCompanion();
|
||||
|
||||
runApp(
|
||||
MeshCoreApp(
|
||||
@@ -218,7 +213,7 @@ class MeshCoreApp extends StatelessWidget {
|
||||
},
|
||||
home: (PlatformInfo.isWeb && !PlatformInfo.isChrome)
|
||||
? const ChromeRequiredScreen()
|
||||
: const ScannerScreen(),
|
||||
: const ContactsScreen(),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user