1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2025-12-07 13:03:59 +00:00
This commit is contained in:
Sunwuyuan 2025-12-06 12:03:04 +08:00
commit 3d81ddb8f9
No known key found for this signature in database
GPG Key ID: A6A54CF66F56BB64
2 changed files with 6 additions and 7 deletions

View File

@ -681,17 +681,14 @@ export default {
try {
this.persistentNotifications = this.persistentNotifications.filter(n => n.id !== id)
await dataProvider.saveData('notification-list', this.persistentNotifications)
// {} []
const dataToSave = this.persistentNotifications.length > 0 ? this.persistentNotifications : {}
await dataProvider.saveData('notification-list', dataToSave)
this.$message?.success('已删除')
} catch (e) {
console.error('删除失败', e)
this.$message?.error('删除失败')
}
},
deletePersistentNotification(id) {
this.itemToDelete = id
this.deleteConfirmDialog = true
}
}
}

View File

@ -2066,7 +2066,9 @@ export default {
},
async removePersistentNotification(id) {
this.persistentNotifications = this.persistentNotifications.filter(n => n.id !== id);
await dataProvider.saveData('notification-list', this.persistentNotifications);
// {} []
const dataToSave = this.persistentNotifications.length > 0 ? this.persistentNotifications : {};
await dataProvider.saveData('notification-list', dataToSave);
this.notificationDetailDialog = false;
},
},