@@ -77,8 +77,9 @@ struct ShippingLabelAddNewPackage: View {
7777 } )
7878 . disabled ( isSyncing)
7979 . alert ( isPresented: $showingAddPackageError, content: {
80- Alert ( title: Text ( Localization . errorAlertTitle) ,
81- message: Text ( Localization . errorAlertMessage) )
80+ let title = viewModel. error? . alertTitle ?? Localization . errorAlertTitle
81+ let message = viewModel. error? . errorDescription ?? Localization . errorAlertMessage
82+ return Alert ( title: Text ( title) , message: Text ( message) )
8283 } )
8384 } )
8485 }
@@ -92,10 +93,9 @@ private extension ShippingLabelAddNewPackage {
9293 static let customPackage = NSLocalizedString ( " Custom Package " , comment: " Custom Package menu in Shipping Label Add New Package flow " )
9394 static let servicePackage = NSLocalizedString ( " Service Package " , comment: " Service Package menu in Shipping Label Add New Package flow " )
9495 static let doneButton = NSLocalizedString ( " Done " , comment: " Done navigation button in the Add New Package screen in Shipping Label flow " )
95- static let errorAlertTitle = NSLocalizedString ( " Cannot add package " ,
96- comment: " Title of the alert when there is a failure adding a package in the Shipping Label flow " )
96+ static let errorAlertTitle = NSLocalizedString ( " Cannot add package " , comment: " The title of the alert when there is a generic error adding the package " )
9797 static let errorAlertMessage = NSLocalizedString ( " Unexpected error " ,
98- comment: " Message of the alert when there is a failure adding a package in the Shipping Label flow " )
98+ comment: " The message of the alert when there is an unexpected error adding the package " )
9999 }
100100}
101101
0 commit comments