Skip to content

Commit

Permalink
small fix in wishes view controller
Browse files Browse the repository at this point in the history
  • Loading branch information
nedley committed Oct 2, 2019
1 parent 20b52ff commit 22bcd2f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
11 changes: 10 additions & 1 deletion appdb/Resources/• MessagesFactory/MessagesFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ struct Messages {

func getConfig(_ context: SwiftMessages.PresentationContext? = nil) -> SwiftMessages.Config {
var config = SwiftMessages.Config()
config.presentationStyle = Preferences.adBannerHeight > 0 ? .top : .bottom
switch context {
case .viewController(let vc):
if vc is FulfilledWishes || vc is NewWishes {
config.presentationStyle = .bottom
} else {
config.presentationStyle = Preferences.adBannerHeight > 0 ? .top : .bottom
}
default:
config.presentationStyle = Preferences.adBannerHeight > 0 ? .top : .bottom
}
config.presentationContext = context ?? .automatic
config.dimMode = .none
return config
Expand Down
1 change: 1 addition & 0 deletions appdb/Startup/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ extension String {
case "ERROR_REQUEST_STATUS_CANT_BE_SET": return "This request status can't be set.".localized()
case "ERROR_SUCH_REQUEST_EXISTS": return "Such request already exists. But we have added you as requester as well.".localized()
case "ERROR_SUCH_VERSION_EXISTS_AND_LINKS_AVAILABLE": return "Such version is already on appdb and it has links available.".localized()
case "ERROR_INVALID_APPSTORE_URL": return "Invalid AppStore URL.".localized()
case "JSON could not be serialized because of error:\nThe data couldn’t be read because it isn’t in the correct format.": return "An error has occurred: malformed JSON".localized()
default: return self.localized()
}
Expand Down
4 changes: 2 additions & 2 deletions appdb/Tabs/Featured/Wishes/Wishes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ extension Wishes {
guard let url = URL(string: text) else { return }
API.createPublishRequest(appStoreUrl: url.absoluteString) { error in
if let error = error {
Messages.shared.showError(message: error, context: Global.isIpad ? .viewController(self) : nil)
Messages.shared.showError(message: error.prettified, context: .viewController(self))
} else {
Messages.shared.showSuccess(message: "App has been requested successfully!".localized(), context: Global.isIpad ? .viewController(self) : nil)
Messages.shared.showSuccess(message: "App has been requested successfully!".localized(), context: .viewController(self))
}
}
})
Expand Down

0 comments on commit 22bcd2f

Please sign in to comment.