Cache Jarvis app config on startup
This commit is contained in:
@@ -7,6 +7,7 @@ class AccountsPage extends StatefulWidget {
|
||||
required this.cachedEvents,
|
||||
required this.people,
|
||||
required this.jarvisSettings,
|
||||
required this.serverClientId,
|
||||
required this.onChanged,
|
||||
required this.onSyncedEventsChanged,
|
||||
});
|
||||
@@ -15,6 +16,7 @@ class AccountsPage extends StatefulWidget {
|
||||
final List<CalendarEvent> cachedEvents;
|
||||
final List<Person> people;
|
||||
final JarvisSettings jarvisSettings;
|
||||
final String serverClientId;
|
||||
final ValueChanged<List<GoogleCalendarConnection>> onChanged;
|
||||
final ValueChanged<List<CalendarEvent>> onSyncedEventsChanged;
|
||||
|
||||
@@ -51,9 +53,10 @@ class _AccountsPageState extends State<AccountsPage> {
|
||||
statusMessage = 'Google napt\u00e1rkapcsolat el\u0151k\u00e9sz\u00edt\u00e9se...';
|
||||
});
|
||||
|
||||
final configuredClientId = await _loadGoogleServerClientId();
|
||||
runtimeServerClientId = widget.serverClientId.trim().isNotEmpty
|
||||
? widget.serverClientId.trim()
|
||||
: await _loadGoogleServerClientId();
|
||||
if (!mounted) return;
|
||||
runtimeServerClientId = configuredClientId?.trim();
|
||||
await _initializeGoogle();
|
||||
}
|
||||
|
||||
@@ -147,8 +150,9 @@ class _AccountsPageState extends State<AccountsPage> {
|
||||
|
||||
try {
|
||||
if (!initialized) {
|
||||
final configuredClientId = await _loadGoogleServerClientId();
|
||||
runtimeServerClientId = configuredClientId?.trim();
|
||||
runtimeServerClientId = widget.serverClientId.trim().isNotEmpty
|
||||
? widget.serverClientId.trim()
|
||||
: await _loadGoogleServerClientId();
|
||||
await _ensureGoogleInitialized();
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user