UI/Remove spinner after token renew (#12887)
* fixes loading spinner * adds changelog
This commit is contained in:
parent
fe3abd7e53
commit
1898e6c301
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:bug
|
||||||
|
ui: Remove spinner after token renew
|
||||||
|
```
|
|
@ -40,8 +40,9 @@ export default class AuthInfoComponent extends Component {
|
||||||
renewToken() {
|
renewToken() {
|
||||||
this.fakeRenew = true;
|
this.fakeRenew = true;
|
||||||
run.later(() => {
|
run.later(() => {
|
||||||
this.fakeRenew = false;
|
this.auth.renew().then(() => {
|
||||||
this.auth.renew();
|
this.fakeRenew = this.auth.isRenewing;
|
||||||
|
});
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ export default Service.extend({
|
||||||
namespaceService: service('namespace'),
|
namespaceService: service('namespace'),
|
||||||
IDLE_TIMEOUT: 3 * 60e3,
|
IDLE_TIMEOUT: 3 * 60e3,
|
||||||
expirationCalcTS: null,
|
expirationCalcTS: null,
|
||||||
|
isRenewing: false,
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
this.checkForRootToken();
|
this.checkForRootToken();
|
||||||
|
@ -249,14 +250,14 @@ export default Service.extend({
|
||||||
if (currentlyRenewing) {
|
if (currentlyRenewing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.set('isRenewing', true);
|
this.isRenewing = true;
|
||||||
return this.renewCurrentToken().then(
|
return this.renewCurrentToken().then(
|
||||||
resp => {
|
resp => {
|
||||||
this.set('isRenewing', false);
|
this.isRenewing = false;
|
||||||
return this.persistAuthData(tokenName, resp.data || resp.auth);
|
return this.persistAuthData(tokenName, resp.data || resp.auth);
|
||||||
},
|
},
|
||||||
e => {
|
e => {
|
||||||
this.set('isRenewing', false);
|
this.isRenewing = false;
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
{{#if (is-before (now interval=1000) this.auth.tokenExpirationDate)}}
|
{{#if (is-before (now interval=1000) this.auth.tokenExpirationDate)}}
|
||||||
{{#if this.auth.authData.renewable}}
|
{{#if this.auth.authData.renewable}}
|
||||||
<li class="action">
|
<li class="action">
|
||||||
<button type="button" {{action "renewToken"}} class="link button {{if this.isRenewing 'is-loading'}}">
|
<button type="button" {{on "click" this.renewToken}} class="link button {{if this.isRenewing 'is-loading'}}">
|
||||||
Renew token
|
Renew token
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in New Issue