mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-04 01:29:21 +00:00
Hotfix/add autoreload (#9269)
* Added auto refresh on server update back * Fixed lint * Updated copy
This commit is contained in:
parent
c24545cae5
commit
c39505d41c
3 changed files with 10 additions and 15 deletions
|
|
@ -214,19 +214,15 @@ export default {
|
|||
}
|
||||
|
||||
// Verify the client is updated
|
||||
// const serverAppVersion = response.data.appVersion;
|
||||
// let serverAppVersionState = this.$store.state.serverAppVersion;
|
||||
// let deniedUpdate = this.$store.state.deniedUpdate;
|
||||
// if (isApiCall && !serverAppVersionState) {
|
||||
// this.$store.state.serverAppVersion = serverAppVersion;
|
||||
// } else if (isApiCall && serverAppVersionState !== serverAppVersion && !deniedUpdate || isCron) {
|
||||
// // For reload on cron
|
||||
// if (isCron || confirm(this.$t('habiticaHasUpdated'))) {
|
||||
// location.reload(true);
|
||||
// } else {
|
||||
// this.$store.state.deniedUpdate = true;
|
||||
// }
|
||||
// }
|
||||
const serverAppVersion = response.data.appVersion;
|
||||
let serverAppVersionState = this.$store.state.serverAppVersion;
|
||||
if (isApiCall && !serverAppVersionState) {
|
||||
this.$store.state.serverAppVersion = serverAppVersion;
|
||||
} else if (isApiCall && serverAppVersionState !== serverAppVersion) {
|
||||
if (document.activeElement.tagName !== 'INPUT' || confirm(this.$t('habiticaHasUpdated'))) {
|
||||
location.reload(true);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ export default function () {
|
|||
getters,
|
||||
state: {
|
||||
serverAppVersion: '',
|
||||
deniedUpdate: false,
|
||||
title: 'Habitica',
|
||||
isUserLoggedIn,
|
||||
isUserLoaded: false, // Means the user and the user's tasks are ready
|
||||
|
|
|
|||
|
|
@ -282,5 +282,5 @@
|
|||
"letsgo": "Let's Go!",
|
||||
"selected": "Selected",
|
||||
"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!"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue