feat: Display warning banner on unverified devices
This commit is contained in:
parent
f49a653c75
commit
d8acd92023
6 changed files with 73 additions and 2 deletions
|
|
@ -32,6 +32,28 @@ class DevicesSettingsController extends State<DevicesSettings> {
|
|||
bool loadingDeletingDevices = false;
|
||||
String? errorDeletingDevices;
|
||||
|
||||
bool? chatBackupEnabled;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_checkChatBackup();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void _checkChatBackup() async {
|
||||
final client = Matrix.of(context).client;
|
||||
if (client.encryption?.keyManager.enabled == true) {
|
||||
if (await client.encryption?.keyManager.isCached() == false ||
|
||||
await client.encryption?.crossSigning.isCached() == false ||
|
||||
client.isUnknownSession && !mounted) {
|
||||
setState(() {
|
||||
chatBackupEnabled = false;
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void removeDevicesAction(List<Device> devices) async {
|
||||
if (await showOkCancelAlertDialog(
|
||||
context: context,
|
||||
|
|
|
|||
|
|
@ -48,6 +48,19 @@ class DevicesSettingsView extends StatelessWidget {
|
|||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (controller.chatBackupEnabled == false)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: ListTile(
|
||||
leading: const CircleAvatar(
|
||||
child: Icon(Icons.info_outlined),
|
||||
),
|
||||
subtitle: Text(
|
||||
L10n.of(context)
|
||||
.noticeChatBackupDeviceVerification,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (controller.thisDevice != null) ...[
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue