Hotfix/add autoreload (#9269)

* Added auto refresh on server update back

* Fixed lint

* Updated copy
This commit is contained in:
Keith Holliday
2017-10-25 15:22:26 -05:00
committed by Sabe Jones
parent c24545cae5
commit c39505d41c
3 changed files with 10 additions and 15 deletions

View File

@@ -214,19 +214,15 @@ export default {
} }
// Verify the client is updated // Verify the client is updated
// const serverAppVersion = response.data.appVersion; const serverAppVersion = response.data.appVersion;
// let serverAppVersionState = this.$store.state.serverAppVersion; let serverAppVersionState = this.$store.state.serverAppVersion;
// let deniedUpdate = this.$store.state.deniedUpdate; if (isApiCall && !serverAppVersionState) {
// if (isApiCall && !serverAppVersionState) { this.$store.state.serverAppVersion = serverAppVersion;
// this.$store.state.serverAppVersion = serverAppVersion; } else if (isApiCall && serverAppVersionState !== serverAppVersion) {
// } else if (isApiCall && serverAppVersionState !== serverAppVersion && !deniedUpdate || isCron) { if (document.activeElement.tagName !== 'INPUT' || confirm(this.$t('habiticaHasUpdated'))) {
// // For reload on cron location.reload(true);
// if (isCron || confirm(this.$t('habiticaHasUpdated'))) { }
// location.reload(true); }
// } else {
// this.$store.state.deniedUpdate = true;
// }
// }
return response; return response;
}); });

View File

@@ -56,7 +56,6 @@ export default function () {
getters, getters,
state: { state: {
serverAppVersion: '', serverAppVersion: '',
deniedUpdate: false,
title: 'Habitica', title: 'Habitica',
isUserLoggedIn, isUserLoggedIn,
isUserLoaded: false, // Means the user and the user's tasks are ready isUserLoaded: false, // Means the user and the user's tasks are ready

View File

@@ -282,5 +282,5 @@
"letsgo": "Let's Go!", "letsgo": "Let's Go!",
"selected": "Selected", "selected": "Selected",
"howManyToBuy": "How many would you like to buy?", "howManyToBuy": "How many would you like to buy?",
"habiticaHasUpdated": "There is a new version of Habitica. Would you like to refresh to get the latest updates?" "habiticaHasUpdated": "There is a new Habitica update. Refresh to get the latest version!"
} }