add checkmark to notification card to mark notification as read
This commit is contained in:
		
							parent
							
								
									040bb53383
								
							
						
					
					
						commit
						344da326cd
					
				
					 4 changed files with 20 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -115,6 +115,12 @@ class SubscriptionManager {
 | 
			
		|||
            .delete();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async markNotificationRead(notificationId) {
 | 
			
		||||
        await db.notifications
 | 
			
		||||
            .where({id: notificationId, new: 1})
 | 
			
		||||
            .modify({new: 0});
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async markNotificationsRead(subscriptionId) {
 | 
			
		||||
        await db.notifications
 | 
			
		||||
            .where({subscriptionId: subscriptionId, new: 1})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,9 +8,9 @@ import Dexie from 'dexie';
 | 
			
		|||
 | 
			
		||||
const db = new Dexie('ntfy');
 | 
			
		||||
 | 
			
		||||
db.version(1).stores({
 | 
			
		||||
db.version(2).stores({
 | 
			
		||||
    subscriptions: '&id,baseUrl',
 | 
			
		||||
    notifications: '&id,subscriptionId,time,new,[subscriptionId+new]', // compound key for query performance
 | 
			
		||||
    notifications: '&id,subscriptionId,time,new,[subscriptionId+new],[id+new]', // compound keys for query performance
 | 
			
		||||
    users: '&baseUrl,username',
 | 
			
		||||
    prefs: '&key'
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue