Fix encryptionEnabled check
This commit is contained in:
parent
d367d22250
commit
38b5260e48
|
@ -97,11 +97,6 @@ class MatrixState extends State<Matrix> {
|
||||||
|
|
||||||
hideLoadingDialog() => Navigator.of(_loadingDialogContext)?.pop();
|
hideLoadingDialog() => Navigator.of(_loadingDialogContext)?.pop();
|
||||||
|
|
||||||
bool get encryptionEnabled =>
|
|
||||||
client.userDeviceKeys.containsKey(client.userID) &&
|
|
||||||
client.userDeviceKeys[client.userID].deviceKeys
|
|
||||||
.containsKey(client.deviceID);
|
|
||||||
|
|
||||||
Future<String> downloadAndSaveContent(MxContent content,
|
Future<String> downloadAndSaveContent(MxContent content,
|
||||||
{int width, int height, ThumbnailMethod method}) async {
|
{int width, int height, ThumbnailMethod method}) async {
|
||||||
final bool thumbnail = width == null && height == null ? false : true;
|
final bool thumbnail = width == null && height == null ? false : true;
|
||||||
|
|
|
@ -64,7 +64,7 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
|
||||||
color: room.encrypted ? Colors.green : Colors.red),
|
color: room.encrypted ? Colors.green : Colors.red),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (room.encrypted) return;
|
if (room.encrypted) return;
|
||||||
if (!Matrix.of(context).encryptionEnabled) {
|
if (!room.client.encryptionEnabled) {
|
||||||
Toast.show(I18n.of(context).needPantalaimonWarning, context,
|
Toast.show(I18n.of(context).needPantalaimonWarning, context,
|
||||||
duration: 8);
|
duration: 8);
|
||||||
return;
|
return;
|
||||||
|
@ -84,7 +84,7 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
|
||||||
ListTile(
|
ListTile(
|
||||||
trailing: Icon(Icons.info),
|
trailing: Icon(Icons.info),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
Matrix.of(context).encryptionEnabled
|
room.client.encryptionEnabled
|
||||||
? I18n.of(context).warningEncryptionInBeta
|
? I18n.of(context).warningEncryptionInBeta
|
||||||
: I18n.of(context).needPantalaimonWarning,
|
: I18n.of(context).needPantalaimonWarning,
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue