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
|
||||
// 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!"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user