From b3cc30a207fab2cb6e0ddfb868e9cfff7d913a0d Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Fri, 2 Nov 2018 12:05:40 +0530 Subject: [PATCH] Tunnel view model: Initialize peerData.numberOfPeers Signed-off-by: Roopesh Chander --- WireGuard/WireGuard/UI/TunnelViewModel.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WireGuard/WireGuard/UI/TunnelViewModel.swift b/WireGuard/WireGuard/UI/TunnelViewModel.swift index 8143ba3..0886848 100644 --- a/WireGuard/WireGuard/UI/TunnelViewModel.swift +++ b/WireGuard/WireGuard/UI/TunnelViewModel.swift @@ -375,6 +375,10 @@ class TunnelViewModel { peersData.append(peerData) } } + let numberOfPeers = peersData.count + for peerData in peersData { + peerData.numberOfPeers = numberOfPeers + } } func appendEmptyPeer() {