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() {
|
||||
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);
|
||||
|
|
|
@ -30,15 +30,9 @@ function interceptor($q, vnApp, vnToken, $translate) {
|
|||
},
|
||||
response(response) {
|
||||
vnApp.popLoader();
|
||||
const currentVersion = localStorage.getItem('salix-version');
|
||||
const newVersion = response.headers('salix-version');
|
||||
if (newVersion) {
|
||||
if (newVersion != currentVersion) {
|
||||
vnApp.hasNewVersion = true;
|
||||
clearInterval(vnApp.versionInterval);
|
||||
}
|
||||
localStorage.setItem('salix-version', newVersion);
|
||||
}
|
||||
vnApp.setVersion(newVersion);
|
||||
|
||||
return response;
|
||||
},
|
||||
responseError(rejection) {
|
||||
|
|
Loading…
Reference in New Issue