Kaynağa Gözat

Handle null case for invalid ng-model value (fixes #2392)

Invalid ng-model value is assigned `null` by angular.js which is being matched as `object`, thus disappear in the UI when a minus sign is entered.
Benny Ng 9 yıl önce
ebeveyn
işleme
24023ff9e8
3 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  1. 1 0
      AUTHORS
  2. 1 0
      NICKS
  3. 3 0
      gui/default/syncthing/core/syncthingController.js

+ 1 - 0
AUTHORS

@@ -13,6 +13,7 @@ Bart De Vries <[email protected]>
 Ben Curthoys <[email protected]>
 Ben Schulz <[email protected]> <[email protected]>
 Ben Sidhom <[email protected]>
+Benny Ng <[email protected]>
 Brandon Philips <[email protected]>
 Brendan Long <[email protected]>
 Brian R. Becker <[email protected]>


+ 3 - 0
gui/default/syncthing/core/syncthingController.js

@@ -1531,6 +1531,9 @@ angular.module('syncthing.core')
             if (key.substr(0, 1) === '_') {
                 return 'skip';
             }
+            if (value === null) {
+                return 'null';
+            }
             if (typeof value === 'number') {
                 return 'number';
             }