From 3223ee7fd1fe4859a624f1fec5dfce6e57f79fdc Mon Sep 17 00:00:00 2001
From: josh <josh@elixxir.io>
Date: Wed, 26 May 2021 10:30:36 -0700
Subject: [PATCH] Move delete contact CLI logic

---
 cmd/root.go | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/cmd/root.go b/cmd/root.go
index 6a8329f13..469b227d3 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -157,12 +157,6 @@ var rootCmd = &cobra.Command{
 			authConfirmed = true
 		}
 
-		// Delete this recipient
-		if viper.GetBool("delete-channel") {
-			jww.FATAL.Printf("Deleting contact with ID %s", recipientID)
-			deleteChannel(client, recipientID)
-		}
-
 		if client.HasAuthenticatedChannel(recipientID) {
 			jww.INFO.Printf("Authenticated channel already in "+
 				"place for %s", recipientID)
@@ -202,6 +196,12 @@ var rootCmd = &cobra.Command{
 				" took %d seconds", scnt)
 		}
 
+		// Delete this recipient
+		if viper.GetBool("delete-channel") {
+			jww.FATAL.Printf("Deleting contact with ID %s", recipientID)
+			deleteChannel(client, recipientID)
+		}
+
 		msg := message.Send{
 			Recipient:   recipientID,
 			Payload:     []byte(msgBody),
-- 
GitLab