move funcionality setVersion to vnApp
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
a4aa3f9133
commit
1a88ccaae5
|
@ -43,6 +43,17 @@ export default class App {
|
||||||
getVersion() {
|
getVersion() {
|
||||||
this.logger.$http.get('Applications/status');
|
this.logger.$http.get('Applications/status');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setVersion(newVersion) {
|
||||||
|
if (newVersion) {
|
||||||
|
const currentVersion = localStorage.getItem('salix-version');
|
||||||
|
if (newVersion != currentVersion) {
|
||||||
|
this.hasNewVersion = true;
|
||||||
|
clearInterval(this.versionInterval);
|
||||||
|
}
|
||||||
|
localStorage.setItem('salix-version', newVersion);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngModule.service('vnApp', App);
|
ngModule.service('vnApp', App);
|
||||||
|
|
|
@ -30,15 +30,9 @@ function interceptor($q, vnApp, vnToken, $translate) {
|
||||||
},
|
},
|
||||||
response(response) {
|
response(response) {
|
||||||
vnApp.popLoader();
|
vnApp.popLoader();
|
||||||
const currentVersion = localStorage.getItem('salix-version');
|
|
||||||
const newVersion = response.headers('salix-version');
|
const newVersion = response.headers('salix-version');
|
||||||
if (newVersion) {
|
vnApp.setVersion(newVersion);
|
||||||
if (newVersion != currentVersion) {
|
|
||||||
vnApp.hasNewVersion = true;
|
|
||||||
clearInterval(vnApp.versionInterval);
|
|
||||||
}
|
|
||||||
localStorage.setItem('salix-version', newVersion);
|
|
||||||
}
|
|
||||||
return response;
|
return response;
|
||||||
},
|
},
|
||||||
responseError(rejection) {
|
responseError(rejection) {
|
||||||
|
|
Loading…
Reference in New Issue