Aaron Toth avatar Aaron Toth committed bbce45a

Fixed issue with deleting items in accounts list, and updating after adding account and welcome screen

Comments (0)

Files changed (2)

source/Pinnned.js

     },
     welcomeDone: function(inSender, inNew) {
         var accounts = inNew;
+        this.$.preferencesView.receiveAccounts(accounts);
         this.$.mainView.receiveAccounts(accounts);
         this.$.mainPane.selectViewByName('mainView');
     },

source/views/Preferences.js

                 {kind: "Spacer", flex: 1},
                 {name: "serviceIcon"+i, kind: "Image", src: this.$.accountUtilities.smallServiceIconFromNumber(this.accounts[i].service), className: "preferences-account-serviceicon"},
                 {name: "service"+i, content: this.$.accountUtilities.serviceNameFromNumber(this.accounts[i].service), className: "preferences-account-service"},
-                {name: "Spacer", flex: 2},
-                {name: "deleteAccount", kind: "Button", className: "enyo-button-negative", caption: "Delete", onclick: "deleteAccount"}
-                
+                {kind: "Spacer", flex: 2},
+                {kind: "Button", className: "enyo-button-negative", caption: "Delete", onclick: "deleteAccount"}
+
             ]});
         }
         this.$.accountsList.createComponents(componentsToAdd, {owner: this});
         this.$.accountsList.render();
     },
+    receiveAccounts: function(accounts) {
+        this.accounts = accounts;
+        this.setupAccounts();
+    },
     deleteAccount: function(inSender, inEvent) {
         var index = parseInt(inEvent.dispatchTarget.container.components[0].name);
         enyo.log(index);
             username: inSender.username(),
             password: inSender.password()
         };
-        this.$.accountUtilities.addAccount(account);
-        this.accounts = this.$.accountUtilities.getAccounts();
+        this.accounts.push(account);
         inSender.clear();
         this.setupAccounts();
     },
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.