Proyectos de Subversion Iphone Microlearning - Inconcert

Rev

Rev 11 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 17
Línea 19... Línea 19...
19
    
19
    
Línea 20... Línea 20...
20
    private let appData = AppData.sharedInstance
20
    private let appData = AppData.sharedInstance
Línea 21... Línea 21...
21
    
21
    
Línea 22... Línea 22...
22
    init() {
22
    init() {
Línea 23... Línea 23...
23
 
23
 
24
        let userNotificationDao = UserNotificationDao.sharedInstance
24
        let userNotificationDao = UserNotificationDao()
Línea 66... Línea 66...
66
                        
66
                        
67
 
67
 
68
                        
68
                        
Línea 69... Línea 69...
69
                            
69
                            
70
                        ForEach(self.viewModel.notifications) { notificationItem  in
-
 
-
 
70
                        ForEach(self.viewModel.notifications) { notificationItem  in
71
                                
71
                            
Línea 72... Línea 72...
72
                            //let notificationItem = self.viewModel.notifications[index]
72
                            //let notificationItem = self.viewModel.notifications[index]
73
                            
73
                            
Línea 74... Línea 74...
74
                                NotificationListItemView(notification: notificationItem,onExecute: {
74
                            NotificationListItemView(notification: notificationItem).onTapGesture {
75
                                    
75
                                if !notificationItem.command.isEmpty && notificationItem.viewed == 0 {
Línea 85... Línea 85...
85
                                            appNavigation.subpageActive = .topics
85
                                            appNavigation.subpageActive = .topics
86
                                        }
86
                                        }
Línea 87... Línea 87...
87
                                        
87
                                        
88
                                        
88
                                        
89
                                    } else if notificationItem.command == Constants.NOTIFICATION_COMMAND_OPEN_URL &&
89
                                    } else if notificationItem.command == Constants.NOTIFICATION_COMMAND_OPEN_URL &&
Línea 90... Línea 90...
90
                                        !notificationItem.url.isEmpty  &&
90
                                                !notificationItem.url.isEmpty  &&
91
                                        notificationItem.viewed == 0  {
91
                                                notificationItem.viewed == 0  {
Línea 92... Línea 92...
92
                                        
92
                                        
Línea 93... Línea 93...
93
                                        
93
                                        
94
                                        let notificationDao = UserNotificationDao.sharedInstance
94
                                        let notificationDao = UserNotificationDao()
Línea 95... Línea 95...
95
                                        notificationDao.markViewed(id: notificationItem.id)
95
                                        notificationDao.markViewed(id: notificationItem.id)
96
                                        
-
 
97
                                        self.viewModel.fetchAll()
96
                                        
98
                                        
-
 
99
                                        self.sheetURL =  notificationItem.url
97
                                        self.viewModel.fetchAll()
100
                                        self.sheetShow = true
98
                                        
101
                                        
99
                                        self.sheetURL =  notificationItem.url
Línea 102... Línea 100...
102
                                    }
100
                                        self.sheetShow = true
103
                                    
101
                                        
104
                                }) {
102
                                    }
Línea 105... Línea 103...
105
                                    
103
                                } else {
-
 
104
                                    DispatchQueue.main.async {
-
 
105
                                        let notificationDao = UserNotificationDao()
Línea 106... Línea 106...
106
                                    DispatchQueue.main.async {
106
                                        notificationDao.remove(id: notificationItem.id)
107
                                        let notificationDao = UserNotificationDao.sharedInstance
107
                                        
108
                                        notificationDao.remove(id: notificationItem.id)
108
                                        self.viewModel.fetchAll()
109
                                        
109
                                    }