mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Quick fix (#9257)
* Removed hard refresh * Changed sorting to happen during compute
This commit is contained in:
@@ -214,19 +214,19 @@ 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;
|
||||
// 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;
|
||||
// }
|
||||
// }
|
||||
|
||||
return response;
|
||||
});
|
||||
|
||||
@@ -297,8 +297,25 @@ export default {
|
||||
}),
|
||||
taskList () {
|
||||
// @TODO: This should not default to user's tasks. It should require that you pass options in
|
||||
if (this.taskListOverride) return this.taskListOverride;
|
||||
return this.tasks[`${this.type}s`];
|
||||
const filter = this.activeFilters[this.type];
|
||||
|
||||
let taskList = this.tasks[`${this.type}s`];
|
||||
if (this.taskListOverride) taskList = this.taskListOverride;
|
||||
|
||||
if (taskList.length > 0 && ['scheduled', 'due'].indexOf(filter.label) === -1) {
|
||||
let taskListSorted = this.$store.dispatch('tasks:order', [
|
||||
taskList,
|
||||
this.user.tasksOrder,
|
||||
]);
|
||||
|
||||
taskList = taskListSorted[`${this.type}s`];
|
||||
}
|
||||
|
||||
if (filter.sort) {
|
||||
taskList = sortBy(taskList, filter.sort);
|
||||
}
|
||||
|
||||
return taskList;
|
||||
},
|
||||
inAppRewards () {
|
||||
let watchRefresh = this.forceRefresh; // eslint-disable-line
|
||||
@@ -408,18 +425,6 @@ export default {
|
||||
this.loadCompletedTodos();
|
||||
}
|
||||
this.activeFilters[type] = filter;
|
||||
|
||||
if (['scheduled', 'due'].indexOf(filter.label) === -1) {
|
||||
let sortedTasks = this.$store.dispatch('tasks:order', [
|
||||
this.tasks[`${type}s`],
|
||||
this.user.tasksOrder,
|
||||
]);
|
||||
this.tasks[`${type}s`] = sortedTasks[`${type}s`];
|
||||
}
|
||||
|
||||
if (filter.sort) {
|
||||
this.tasks[`${type}s`] = sortBy(this.tasks[`${type}s`], filter.sort);
|
||||
}
|
||||
},
|
||||
setColumnBackgroundVisibility () {
|
||||
this.$nextTick(() => {
|
||||
|
||||
Reference in New Issue
Block a user