fix: Bootstrap hint
This commit is contained in:
parent
e0716f643c
commit
78839fdc65
3 changed files with 74 additions and 35 deletions
|
|
@ -378,6 +378,34 @@ class _SettingsState extends State<Settings> {
|
|||
.textTheme
|
||||
.headline6
|
||||
.color)),
|
||||
actions: [
|
||||
FutureBuilder(
|
||||
future: crossSigningCachedFuture,
|
||||
builder: (context, snapshot) {
|
||||
final needsBootstrap = Matrix.of(context)
|
||||
.client
|
||||
.encryption
|
||||
.crossSigning
|
||||
.enabled ==
|
||||
false ||
|
||||
snapshot.data == false;
|
||||
final isUnknownSession =
|
||||
Matrix.of(context).client.isUnknownSession;
|
||||
final displayHeader = needsBootstrap || isUnknownSession;
|
||||
if (!displayHeader) return Container();
|
||||
return TextButton.icon(
|
||||
icon: Icon(Icons.cloud, color: Colors.red),
|
||||
label: Text(
|
||||
L10n.of(context).chatBackup,
|
||||
style: TextStyle(color: Colors.red),
|
||||
),
|
||||
onPressed: () async {
|
||||
await BootstrapDialog().show(context);
|
||||
AdaptivePageLayout.of(context).popUntilIsFirst();
|
||||
},
|
||||
);
|
||||
}),
|
||||
],
|
||||
backgroundColor: Theme.of(context).appBarTheme.color,
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
background: ContentBanner(profile?.avatarUrl,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue