[gnome-shell/wip/fmuellner/minor-bug-fixes: 3/9] appFavorites: Fix nonsense condition



commit 597249f5d87bef835f67373c9c7ee46a4ba9d615
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jan 29 22:43:41 2019 +0100

    appFavorites: Fix nonsense condition
    
    The "in" operator has a lower precedence than negation, so we are
    actually testing whether the favorites map contains "false".
    
    Add parentheses to get the intended behavior.
    
    Spotted by eslint.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375

 js/ui/appFavorites.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/appFavorites.js b/js/ui/appFavorites.js
index 0bdf41b22..cc3e3c32a 100644
--- a/js/ui/appFavorites.js
+++ b/js/ui/appFavorites.js
@@ -153,7 +153,7 @@ class AppFavorites {
     }
 
     _removeFavorite(appId) {
-        if (!appId in this._favorites)
+        if (!(appId in this._favorites))
             return false;
 
         let ids = this._getIds().filter(id => id != appId);


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