mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Display error on invalid invoice slug
This commit is contained in:
@@ -272,7 +272,10 @@ public func parseInternalUrl(query: String) -> ParsedInternalUrl? {
|
||||
return .join(String(component.dropFirst()))
|
||||
}
|
||||
} else if pathComponents[0].hasPrefix("$") || pathComponents[0].hasPrefix("%24") {
|
||||
let component = pathComponents[0].replacingOccurrences(of: "%24", with: "$")
|
||||
var component = pathComponents[0].replacingOccurrences(of: "%24", with: "$")
|
||||
if component.hasPrefix("$") {
|
||||
component = String(component[component.index(after: component.startIndex)...])
|
||||
}
|
||||
return .invoice(component)
|
||||
}
|
||||
return .peer(.name(peerName), nil)
|
||||
@@ -745,7 +748,7 @@ private func resolveInternalUrl(context: AccountContext, url: ParsedInternalUrl)
|
||||
}
|
||||
|> map { invoice -> ResolvedUrl? in
|
||||
guard let invoice = invoice else {
|
||||
return nil
|
||||
return .invoice(slug: slug, invoice: nil)
|
||||
}
|
||||
return .invoice(slug: slug, invoice: invoice)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user