mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-02 04:00:36 +00:00
Check user version before adding notifications (#10628)
This commit is contained in:
parent
d198e23de6
commit
0002148326
1 changed files with 9 additions and 4 deletions
|
|
@ -103,7 +103,7 @@ div
|
|||
|
||||
<style lang='scss'>
|
||||
@import '~client/assets/scss/colors.scss';
|
||||
|
||||
|
||||
/* @TODO: The modal-open class is not being removed. Let's try this for now */
|
||||
.modal {
|
||||
overflow-y: scroll !important;
|
||||
|
|
@ -295,9 +295,14 @@ export default {
|
|||
|
||||
// Set up Error interceptors
|
||||
axios.interceptors.response.use((response) => {
|
||||
if (this.user && response.data && response.data.notifications) {
|
||||
this.$set(this.user, 'notifications', response.data.notifications);
|
||||
}
|
||||
const responseHasNotifications = response.data && response.data.notifications;
|
||||
if (!responseHasNotifications) return response;
|
||||
|
||||
const responseIsUpdateUser = this.user && this.user._v >= response.data.userV;
|
||||
if (!responseIsUpdateUser) return response;
|
||||
|
||||
this.$set(this.user, 'notifications', response.data.notifications);
|
||||
|
||||
return response;
|
||||
}, (error) => {
|
||||
if (error.response.status >= 400) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue