mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix invalid push devices
This commit is contained in:
@@ -6,6 +6,9 @@ import * as Tasks from '../task';
|
||||
import {
|
||||
model as UserNotification,
|
||||
} from '../userNotification';
|
||||
import {
|
||||
model as PushDevice,
|
||||
} from '../pushDevice';
|
||||
import { // eslint-disable-line import/no-cycle
|
||||
userActivityWebhook,
|
||||
} from '../../libs/webhook';
|
||||
@@ -190,6 +193,11 @@ schema.post('init', function postInitUser () {
|
||||
this.notifications = UserNotification.cleanupCorruptData(this.notifications);
|
||||
}
|
||||
|
||||
// Make sure pushDevices are loaded
|
||||
if (this.isDirectSelected('pushDevices')) {
|
||||
this.pushDevices = PushDevice.cleanupCorruptData(this.pushDevices);
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user