Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nedley committed Oct 19, 2019
1 parent f06b3c7 commit acb49e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion appdb/Startup/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDelegat

func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
// Handle IPA
if url.isFileURL && IPAFileManager.shared.supportedFileExtensions.contains(url.pathExtension) {
if url.isFileURL && IPAFileManager.shared.supportedFileExtensions.contains(url.pathExtension.lowercased()) {

if !FileManager.default.isReadableFile(atPath: url.path) {
// Handle 'Open in appdb' from share sheet
Expand Down
4 changes: 2 additions & 2 deletions appdb/Tabs/Downloads/Library/IPAFileManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ struct IPAFileManager {
func moveEventualIPAFilesToDocumentsDirectory(from directory: URL) {
guard FileManager.default.fileExists(atPath: directory.path) else { return }
let inboxContents = try? FileManager.default.contentsOfDirectory(at: directory, includingPropertiesForKeys: nil)
let ipas = inboxContents?.filter { supportedFileExtensions.contains($0.pathExtension) }
let ipas = inboxContents?.filter { supportedFileExtensions.contains($0.pathExtension.lowercased()) }
for ipa in ipas ?? [] {
let url = directory.appendingPathComponent(ipa.lastPathComponent)
moveToDocuments(url: url)
Expand All @@ -325,7 +325,7 @@ struct IPAFileManager {
moveEventualIPAFilesToDocumentsDirectory(from: inboxDirectoryURL())

let contents = try? FileManager.default.contentsOfDirectory(at: documentsDirectoryURL(), includingPropertiesForKeys: nil)
let ipas = contents?.filter { supportedFileExtensions.contains($0.pathExtension) }
let ipas = contents?.filter { supportedFileExtensions.contains($0.pathExtension.lowercased()) }
for ipa in ipas ?? [] {
let filename = ipa.lastPathComponent
let size = getSize(from: filename)
Expand Down
5 changes: 4 additions & 1 deletion appdb/Tabs/Featured/Wishes/Wishes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ extension Wishes {
if !text.hasPrefix("http://"), !text.hasPrefix("https://") {
text = "https://" + text
}
guard let url = URL(string: text) else { return }
guard let url = URL(string: text) else {
Messages.shared.showError(message: "Error: malformed url".localized(), context: .viewController(self))
return
}
API.createPublishRequest(appStoreUrl: url.absoluteString) { error in
if let error = error {
Messages.shared.showError(message: error.prettified, context: .viewController(self))
Expand Down

0 comments on commit acb49e7

Please sign in to comment.