feat(app): the native app signs in at the web login and carries the session on its socket and downloads
This commit is contained in:
@@ -13,6 +13,7 @@ import 'settings_layout.dart';
|
||||
import 'settings_notifications_section.dart';
|
||||
import 'settings_schedules_section.dart';
|
||||
import 'settings_sections.dart';
|
||||
import 'settings_sign_in_section.dart';
|
||||
import 'settings_store.dart';
|
||||
import 'settings_templates_section.dart';
|
||||
|
||||
@@ -35,10 +36,14 @@ class SettingsScreen extends StatefulWidget {
|
||||
this.onOpenTemplates,
|
||||
this.onOpenSchedules,
|
||||
this.notifications,
|
||||
this.showSignIn = false,
|
||||
});
|
||||
|
||||
final transport.PipelinesClient client;
|
||||
|
||||
/// Whether to offer the web sign-in (the native app; a browser has its own).
|
||||
final bool showSignIn;
|
||||
|
||||
/// A fixture/preview seed for the URL field. Persisted settings still load;
|
||||
/// this value takes precedence for the draft and is never written by itself.
|
||||
final Uri? initialEndpoint;
|
||||
@@ -140,6 +145,20 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
serverUrlField: _serverUrlField,
|
||||
),
|
||||
),
|
||||
// A phone signs in at the web login; a browser has its own.
|
||||
if (widget.showSignIn) ...<Widget>[
|
||||
const SizedBox(height: settingsSectionGap),
|
||||
_SettingsSection(
|
||||
title: 'Sign in',
|
||||
child: SettingsSignInSection(
|
||||
endpoint: _controller.serverUrl,
|
||||
onChanged: () {
|
||||
final endpoint = widget.client.endpoint;
|
||||
if (endpoint != null) widget.client.connect(endpoint);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: settingsSectionGap),
|
||||
_SettingsSection(
|
||||
title: 'Workspace',
|
||||
|
||||
Reference in New Issue
Block a user