Proyectos de Subversion Iphone Microlearning - Inconcert

Rev

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

Rev 1 Rev 11
Línea 4... Línea 4...
4
//
4
//
5
//  Created by Efrain Yanez Recanatini on 7/31/22.
5
//  Created by Efrain Yanez Recanatini on 7/31/22.
6
//
6
//
Línea 7... Línea 7...
7
 
7
 
-
 
8
import SwiftUI
Línea 8... Línea 9...
8
import SwiftUI
9
import SafariServices
9
 
-
 
10
struct NotificationListView: View {
10
 
11
    @Environment(\.openURL) var openURL
11
struct NotificationListView: View {
Línea 12... Línea 12...
12
    @EnvironmentObject private var networkMonitor : NetworkMonitor
12
    @EnvironmentObject private var networkMonitor : NetworkMonitor
-
 
13
    @EnvironmentObject private var appNavigation : AppNavigation
-
 
14
    
-
 
15
    @ObservedObject var viewModel :NotificationListViewModel
-
 
16
    
13
    @EnvironmentObject private var appNavigation : AppNavigation
17
    @State private var sheetURL: String = ""
Línea 14... Línea 18...
14
    
18
    @State private var sheetShow = false
Línea 15... Línea 19...
15
    @ObservedObject var viewModel :NotificationListViewModel
19
    
Línea 84... Línea 88...
84
                                        
88
                                        
85
                                    } else if notificationItem.command == Constants.NOTIFICATION_COMMAND_OPEN_URL &&
89
                                    } else if notificationItem.command == Constants.NOTIFICATION_COMMAND_OPEN_URL &&
86
                                        !notificationItem.url.isEmpty  &&
90
                                        !notificationItem.url.isEmpty  &&
Línea 87... Línea -...
87
                                        notificationItem.viewed == 0  {
-
 
-
 
91
                                        notificationItem.viewed == 0  {
88
                                        
92
                                        
89
                                        openURL(URL(string: notificationItem.url)!)
93
                                        
Línea 90... Línea 94...
90
                                        let notificationDao = UserNotificationDao.sharedInstance
94
                                        let notificationDao = UserNotificationDao.sharedInstance
Línea -... Línea 95...
-
 
95
                                        notificationDao.markViewed(id: notificationItem.id)
-
 
96
                                        
-
 
97
                                        self.viewModel.fetchAll()
91
                                        notificationDao.markViewed(id: notificationItem.id)
98
                                        
Línea 92... Línea 99...
92
                                        
99
                                        self.sheetURL =  notificationItem.url
Línea 93... Línea 100...
93
                                        self.viewModel.fetchAll()
100
                                        self.sheetShow = true
Línea 109... Línea 116...
109
                    }
116
                    }
110
                }
117
                }
111
            }.padding(.top, 5)
118
            }.padding(.top, 5)
112
        }.onAppear {
119
        }.onAppear {
113
            viewModel.fetchAll()
120
            viewModel.fetchAll()
-
 
121
        }.popover(isPresented: self.$sheetShow, content: {
-
 
122
            
-
 
123
           
-
 
124
            
-
 
125
            SafariView(sURL: self.sheetURL)
-
 
126
 
-
 
127
            
114
        }
128
        })    }
115
    }
-
 
116
}
129
}
Línea 117... Línea 130...
117
 
130
 
118
struct NotificationListView_Previews: PreviewProvider {
131
struct NotificationListView_Previews: PreviewProvider {
119
    static var previews: some View {
132
    static var previews: some View {