From 137de57e83d6eec314449c5f07dcaa797a466f7d Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Wed, 16 Feb 2022 13:43:46 -0800 Subject: [PATCH 1/3] Check WorkInfo is Null This shouldn't happen in normal use, but can happen in debug builds --- android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt b/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt index 2663f54c..be363968 100644 --- a/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt +++ b/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt @@ -218,7 +218,7 @@ class MainActivity: FlutterActivity() { WorkManager.getInstance(this).enqueue(workRequest) WorkManager.getInstance(applicationContext).getWorkInfoByIdLiveData(workRequest.id).observe( this, Observer { workInfo -> - if (workInfo.state == WorkInfo.State.SUCCEEDED) { + if (workInfo != null && workInfo.state == WorkInfo.State.SUCCEEDED) { val res = workInfo.outputData.keyValueMap.toString() result.success(workInfo.outputData.getString("result")) } From 705b6e02c976346e3838379bc53189241064b20c Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Wed, 16 Feb 2022 13:49:29 -0800 Subject: [PATCH 2/3] Fix overlap in debug settings --- lib/views/globalsettingsview.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/views/globalsettingsview.dart b/lib/views/globalsettingsview.dart index f7d040bd..3a1cd83d 100644 --- a/lib/views/globalsettingsview.dart +++ b/lib/views/globalsettingsview.dart @@ -140,6 +140,7 @@ class _GlobalSettingsViewState extends State { trailing: Container( width: MediaQuery.of(context).size.width / 4, child: DropdownButton( + isExpanded: true, value: settings.uiColumnModeLandscape.toString(), onChanged: (String? newValue) { settings.uiColumnModeLandscape = Settings.uiColumnModeFromString(newValue!); @@ -197,6 +198,7 @@ class _GlobalSettingsViewState extends State { trailing: Container( width: MediaQuery.of(context).size.width / 4, child: DropdownButton( + isExpanded: true, value: settings.notificationContent, onChanged: (NotificationContent? newValue) { settings.notificationContent = newValue!; From 70eb160abc67c830216788771763db81a3081a84 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 22 Feb 2022 11:09:44 -0800 Subject: [PATCH 3/3] Add Message Status Widget to File Bubble Also fix bug in peer settings --- lib/views/peersettingsview.dart | 2 +- lib/widgets/filebubble.dart | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/views/peersettingsview.dart b/lib/views/peersettingsview.dart index 5164cab3..ce311f9a 100644 --- a/lib/views/peersettingsview.dart +++ b/lib/views/peersettingsview.dart @@ -57,7 +57,7 @@ class _PeerSettingsViewState extends State { return LayoutBuilder(builder: (BuildContext context, BoxConstraints viewportConstraints) { String? acnCircuit = Provider.of(context).acnCircuit; - Widget path = Text(Provider.of(context, listen: false).status); + Widget path = Text(Provider.of(context).status); if (acnCircuit != null) { var hops = acnCircuit.split(","); diff --git a/lib/widgets/filebubble.dart b/lib/widgets/filebubble.dart index 4d91de6d..a091c2e5 100644 --- a/lib/widgets/filebubble.dart +++ b/lib/widgets/filebubble.dart @@ -80,6 +80,8 @@ class FileBubbleState extends State { var downloadActive = Provider.of(context).downloadActive(widget.fileKey()); var downloadGotManifest = Provider.of(context).downloadGotManifest(widget.fileKey()); + var messageStatusWidget = MessageBubbleDecoration(ackd: metadata.ackd, errored: metadata.error, prettyDate: prettyDate, fromMe: fromMe); + // If the sender is not us, then we want to give them a nickname... var senderDisplayStr = ""; var senderIsContact = false; @@ -195,7 +197,7 @@ class FileBubbleState extends State { crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start, mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start, mainAxisSize: MainAxisSize.min, - children: [wdgSender, isPreview ? Container() : wdgMessage, wdgDecorations]), + children: [wdgSender, isPreview ? Container() : wdgMessage, wdgDecorations, messageStatusWidget]), )); }); }