From 992438f0546ed4b005745cc0982a6c6e7d8f7637 Mon Sep 17 00:00:00 2001
From: Adam Ierymenko <adam.ierymenko@gmail.com>
Date: Mon, 18 May 2015 16:02:37 -0700
Subject: Confirm leaving networks.

---
 ui/ZeroTierNetwork.jsx | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

(limited to 'ui/ZeroTierNetwork.jsx')

diff --git a/ui/ZeroTierNetwork.jsx b/ui/ZeroTierNetwork.jsx
index f842d758..4b37d888 100644
--- a/ui/ZeroTierNetwork.jsx
+++ b/ui/ZeroTierNetwork.jsx
@@ -4,17 +4,19 @@ var ZeroTierNetwork = React.createClass({
 	},
 
 	leaveNetwork: function(event) {
-		Ajax.call({
-			url: 'network/'+this.props.nwid+'?auth='+this.props.authToken,
-			cache: false,
-			type: 'DELETE',
-			success: function(data) {
-				if (this.props.onNetworkDeleted)
-					this.props.onNetworkDeleted(this.props.nwid);
-			}.bind(this),
-			error: function(error) {
-			}.bind(this)
-		});
+		if (confirm("Are you sure you want to leave this network?")) {
+			Ajax.call({
+				url: 'network/'+this.props.nwid+'?auth='+this.props.authToken,
+				cache: false,
+				type: 'DELETE',
+				success: function(data) {
+					if (this.props.onNetworkDeleted)
+						this.props.onNetworkDeleted(this.props.nwid);
+				}.bind(this),
+				error: function(error) {
+				}.bind(this)
+			});
+		}
 		event.preventDefault();
 	},
 
-- 
cgit v1.2.3

