         } else {
             let markRead = UIContextualAction(style: .normal, title: "Mark as\nRead", handler: { (ac: UIContextualAction, view: UIView, success: (Bool) -> Void) in
                 API.current()?.fetch(SubscriptionReadRequest(rid: subscription.rid), completion: nil)
-                Realm.executeOnMainThread({ (_) in
+                Realm.executeOnMainThread { _ in
                     subscription.alert = false
-                })
+                }
                 success(true)
             })
 

        if !subscription.alert {
            let markUnread = UIContextualAction(style: .normal, title: "Mark as\nUnread", handler: { (ac: UIContextualAction, view: UIView, success: (Bool) -> Void) in
                API.current()?.fetch(SubscriptionUnreadRequest(rid: subscription.rid), completion: nil)
                Realm.executeOnMainThread({ (_) in
                    subscription.alert = true
                })
                success(true)
            })


        hide.backgroundColor = #colorLiteral(red: 0.5568627715, green: 0.3529411852, blue: 0.9686274529, alpha: 1)

        let leave = UIContextualAction(style: .destructive, title:  "Leave\nChannel", handler: { (ac: UIContextualAction, view: UIView, success: (Bool) -> Void) in
            let leaveRequest = SubscriptionLeaveRequest(roomId: subscription.rid, type: subscription.type)
            API.current()?.fetch(leaveRequest, completion: nil)

            Realm.executeOnMainThread { realm in
                realm.delete(subscription)
            }

            success(true)
        })

        leave.backgroundColor = #colorLiteral(red: 0.9254902005, green: 0.2352941185, blue: 0.1019607857, alpha: 1)

        let shouldAddLeaveAction = subscription.type != .directMessage
        let actions = [hide, shouldAddLeaveAction ? leave : nil].compactMap { $0 }
        return UISwipeActionsConfiguration(actions: actions)
    }
}
