[gnome-shell] network: Fix some splice mishaps



commit 20619ad3c129c1d869cd1dd43ab2f743eb1f73ab
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Apr 26 01:34:50 2013 -0400

    network: Fix some splice mishaps
    
    Calling splice() without a second argument removes all of the elements
    after the provided index, not just one.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698918

 js/ui/status/network.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index cb52458..2cef443 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1266,7 +1266,7 @@ const NMDeviceWireless = new Lang.Class({
             for (let k = 0; k < connections.length; k++) {
                 if (connections[k].get_uuid() == connection.get_uuid()) {
                     // remove the connection from the access point group
-                    connections.splice(k);
+                    connections.splice(k, 1);
                     forceupdate = forceupdate || connections.length == 0;
 
                     if (forceupdate)
@@ -2120,7 +2120,7 @@ const NMApplet = new Lang.Class({
     _connectionRemoved: function(connection) {
         let pos = this._connections.indexOf(connection);
         if (pos != -1)
-            this._connections.splice(connection);
+            this._connections.splice(connection, 1);
 
         let section = connection._section;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]