Fix command UI on tablet view

Stephen Paul Weber created

Change summary

src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 4 
1 file changed, 3 insertions(+), 1 deletion(-)

Detailed changes

src/main/java/eu/siacs/conversations/ui/ConversationFragment.java 🔗

@@ -3038,6 +3038,7 @@ public class ConversationFragment extends XmppFragment
                 .setOpenConversation(this.conversation);
 
         if (commandAdapter != null && conversation != originalConversation) {
+            commandAdapter.clear();
             conversation.setupViewPager(binding.conversationViewPager, binding.tabLayout, activity.xmppConnectionService.isOnboarding(), originalConversation);
             refreshCommands(false);
         }
@@ -3049,7 +3050,7 @@ public class ConversationFragment extends XmppFragment
                 if (activity == null) return;
 
                 final Element command = commandAdapter.getItem(position);
-                activity.startCommand(conversation.getAccount(), command.getAttributeAsJid("jid"), command.getAttribute("node"));
+                activity.startCommand(ConversationFragment.this.conversation.getAccount(), command.getAttributeAsJid("jid"), command.getAttribute("node"));
             });
             refreshCommands(false);
         }
@@ -3072,6 +3073,7 @@ public class ConversationFragment extends XmppFragment
             conversation.hideViewPager();
         } else {
             if (!delayShow) conversation.showViewPager();
+            binding.commandsViewProgressbar.setVisibility(View.VISIBLE);
             activity.xmppConnectionService.fetchCommands(conversation.getAccount(), commandJid, (a, iq) -> {
                 if (activity == null) return;