feat(ui): Show something when we have no sessions with a JID

This commit is contained in:
PapaTutuWawa 2023-02-01 13:55:02 +01:00
parent b891f29e11
commit bad4295aec
5 changed files with 25 additions and 2 deletions

View File

@ -218,7 +218,8 @@
"title": "Devices",
"recreateSessions": "Rebuild sessions",
"recreateSessionsConfirmTitle": "Rebuild sessions?",
"recreateSessionsConfirmBody": "This will recreate the cryptographic sessions with your own devices. Use only if your own devices throw decryption errors."
"recreateSessionsConfirmBody": "This will recreate the cryptographic sessions with your own devices. Use only if your own devices throw decryption errors.",
"noSessions": "There are no cryptographic sessions that are used for end-to-end encryption."
}
},
"blocklist": {

View File

@ -218,7 +218,8 @@
"title": "Geräte",
"recreateSessions": "Sessions zurücksetzen",
"recreateSessionsConfirmTitle": "Sessions zurücksetzen?",
"recreateSessionsConfirmBody": "Dies wird alle Sessions mit Deinen Geräten neu erstellen. Tue dies nur, wenn deine Geräte Fehler beim Entschlüsseln erzeugen."
"recreateSessionsConfirmBody": "Dies wird alle Sessions mit Deinen Geräten neu erstellen. Tue dies nur, wenn deine Geräte Fehler beim Entschlüsseln erzeugen.",
"noSessions": "Es sind keine kryptographischen Sessions vorhanden, die für Ende-zu-Ende-Verschlüsselung verwendet werden."
}
},
"blocklist": {

BIN
assets/images/empty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View File

@ -28,6 +28,26 @@ class DevicesPage extends StatelessWidget {
);
}
if (state.devices.isEmpty) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: paddingVeryLarge),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset('assets/images/empty.png'),
Padding(
padding: const EdgeInsets.only(top: 8),
child: Text(
t.pages.profile.devices.noSessions,
textAlign: TextAlign.center,
),
),
],
),
);
}
final hasVerifiedDevices = state.devices.any((item) => item.verified);
return ListView.builder(
itemCount: state.devices.length,

View File

@ -164,6 +164,7 @@ flutter:
- assets/images/logo.png
- assets/images/begin_chat.png
- assets/images/happy_news.png
- assets/images/empty.png
flutter_icons:
android: true