File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed
WooCommerce/Classes/ViewRelated/Notifications Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -215,8 +215,37 @@ extension NotificationsViewController: UITableViewDelegate {
215215 tableView. deselectRow ( at: indexPath, animated: true )
216216
217217 let note = resultsController. object ( at: indexPath)
218- let detailsViewController = NotificationDetailsViewController ( note: note)
219218
219+ switch note. kind {
220+ case . storeOrder:
221+ presentOrderDetails ( for: note)
222+ default :
223+ presentNotificationDetails ( for: note)
224+ }
225+ }
226+ }
227+
228+
229+ // MARK: - Details Rendering
230+ //
231+ private extension NotificationsViewController {
232+
233+ /// Pushes the Order Details associated to a given Note (if possible).
234+ ///
235+ func presentOrderDetails( for note: Note ) {
236+ guard let orderID = note. meta. identifier ( forKey: . order) , let siteID = note. meta. identifier ( forKey: . site) else {
237+ DDLogError ( " ## Notification with [ \( note. noteId) ] lacks its OrderID! " )
238+ return
239+ }
240+
241+ let loaderViewController = OrderLoaderViewController ( orderID: orderID, siteID: siteID)
242+ navigationController? . pushViewController ( loaderViewController, animated: true )
243+ }
244+
245+ /// Pushes the Notification Details associated to a given Note.
246+ ///
247+ func presentNotificationDetails( for note: Note ) {
248+ let detailsViewController = NotificationDetailsViewController ( note: note)
220249 navigationController? . pushViewController ( detailsViewController, animated: true )
221250 }
222251}
You can’t perform that action at this time.
0 commit comments