mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Hotfix/add autoreload (#9269)
* Added auto refresh on server update back * Fixed lint * Updated copy
This commit is contained in:
committed by
Sabe Jones
parent
c24545cae5
commit
c39505d41c
@@ -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;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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!"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user