]> source.dussan.org Git - nextcloud-server.git/commitdiff
Always show delete icon for new tokens
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 10 Aug 2016 06:58:57 +0000 (08:58 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 10 Aug 2016 06:58:57 +0000 (08:58 +0200)
* Always show delete icon
* Hide form if the new icon is deleted

settings/js/authtoken_view.js

index 354173341bcb7568acc1ef5c356b5df6116e6e96..c8cf66a6cea49e947e2273c91ecbe6c48794c8b7 100644 (file)
 
                _newAppPassword: undefined,
 
+               _newAppId: undefined,
+
                _hideAppPasswordBtn: undefined,
 
                _addingToken: false,
                        });
 
                        $.when(creatingToken).done(function (resp) {
+                               // We can delete token we add
+                               resp.deviceToken.canDelete = true;
                                _this.collection.add(resp.deviceToken);
                                _this.render();
                                _this._newAppLoginName.val(resp.loginName);
                                _this._newAppPassword.val(resp.token);
+                               _this._newAppId = resp.deviceToken.id;
                                _this._toggleFormResult(false);
                                _this._newAppPassword.select();
                                _this._tokenName.val('');
                        var $row = $target.closest('tr');
                        var id = $row.data('id');
 
+                       if (id === this._newAppId) {
+                               this._toggleFormResult(true);
+                       }
+
                        var token = this.collection.get(id);
                        if (_.isUndefined(token)) {
                                // Ignore event