mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +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
|
// 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;
|
// 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 && !deniedUpdate || isCron) {
|
// } else if (isApiCall && serverAppVersionState !== serverAppVersion && !deniedUpdate || isCron) {
|
||||||
// For reload on cron
|
// // For reload on cron
|
||||||
if (isCron || confirm(this.$t('habiticaHasUpdated'))) {
|
// if (isCron || confirm(this.$t('habiticaHasUpdated'))) {
|
||||||
location.reload(true);
|
// location.reload(true);
|
||||||
} else {
|
// } else {
|
||||||
this.$store.state.deniedUpdate = true;
|
// this.$store.state.deniedUpdate = true;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -297,8 +297,25 @@ export default {
|
|||||||
}),
|
}),
|
||||||
taskList () {
|
taskList () {
|
||||||
// @TODO: This should not default to user's tasks. It should require that you pass options in
|
// @TODO: This should not default to user's tasks. It should require that you pass options in
|
||||||
if (this.taskListOverride) return this.taskListOverride;
|
const filter = this.activeFilters[this.type];
|
||||||
return this.tasks[`${this.type}s`];
|
|
||||||
|
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 () {
|
inAppRewards () {
|
||||||
let watchRefresh = this.forceRefresh; // eslint-disable-line
|
let watchRefresh = this.forceRefresh; // eslint-disable-line
|
||||||
@@ -408,18 +425,6 @@ export default {
|
|||||||
this.loadCompletedTodos();
|
this.loadCompletedTodos();
|
||||||
}
|
}
|
||||||
this.activeFilters[type] = filter;
|
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 () {
|
setColumnBackgroundVisibility () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user