mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
bef45240bd
commit
b06aacbacb
@ -755,7 +755,7 @@ public class MediaEditorTransitionOutExternalState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public protocol MediaEditorScreenResult {
|
public protocol MediaEditorScreenResult {
|
||||||
|
var target: Stories.PendingTarget { get }
|
||||||
}
|
}
|
||||||
|
|
||||||
public protocol TelegramRootControllerInterface: NavigationController {
|
public protocol TelegramRootControllerInterface: NavigationController {
|
||||||
|
@ -367,7 +367,7 @@ public final class BrowserBookmarksScreen: ViewController {
|
|||||||
|
|
||||||
self.navigationItem.backBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Back, style: .plain, target: nil, action: nil)
|
self.navigationItem.backBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Back, style: .plain, target: nil, action: nil)
|
||||||
|
|
||||||
self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Cancel, style: .plain, target: self, action: #selector(self.cancelPressed))
|
self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Close, style: .plain, target: self, action: #selector(self.cancelPressed))
|
||||||
self.title = self.presentationData.strings.WebBrowser_Bookmarks_Title
|
self.title = self.presentationData.strings.WebBrowser_Bookmarks_Title
|
||||||
|
|
||||||
self.searchContentNode = NavigationBarSearchContentNode(theme: self.presentationData.theme, placeholder: self.presentationData.strings.Common_Search, activate: { [weak self] in
|
self.searchContentNode = NavigationBarSearchContentNode(theme: self.presentationData.theme, placeholder: self.presentationData.strings.Common_Search, activate: { [weak self] in
|
||||||
|
@ -384,13 +384,13 @@ private final class BrowserScreenComponent: CombinedComponent {
|
|||||||
bottomInset: toolbarBottomInset,
|
bottomInset: toolbarBottomInset,
|
||||||
sideInset: environment.safeInsets.left,
|
sideInset: environment.safeInsets.left,
|
||||||
item: toolbarContent,
|
item: toolbarContent,
|
||||||
collapseFraction: collapseFraction
|
collapseFraction: 0.0
|
||||||
),
|
),
|
||||||
availableSize: context.availableSize,
|
availableSize: context.availableSize,
|
||||||
transition: context.transition
|
transition: context.transition
|
||||||
)
|
)
|
||||||
context.add(toolbar
|
context.add(toolbar
|
||||||
.position(CGPoint(x: context.availableSize.width / 2.0, y: context.availableSize.height - toolbar.size.height / 2.0))
|
.position(CGPoint(x: context.availableSize.width / 2.0, y: context.availableSize.height - toolbar.size.height / 2.0 + toolbar.size.height * collapseFraction))
|
||||||
.appear(ComponentTransition.Appear { _, view, transition in
|
.appear(ComponentTransition.Appear { _, view, transition in
|
||||||
transition.animatePosition(view: view, from: CGPoint(x: 0.0, y: view.frame.height), to: CGPoint(), additive: true)
|
transition.animatePosition(view: view, from: CGPoint(x: 0.0, y: view.frame.height), to: CGPoint(), additive: true)
|
||||||
})
|
})
|
||||||
|
@ -244,7 +244,7 @@ final class BrowserWebContent: UIView, BrowserContent, WKNavigationDelegate, WKU
|
|||||||
|
|
||||||
self.errorView = ComponentHostView()
|
self.errorView = ComponentHostView()
|
||||||
|
|
||||||
self._state = BrowserContentState(title: title, url: url, estimatedProgress: 0.0, readingProgress: 0.0, contentType: .webPage)
|
self._state = BrowserContentState(title: title, url: url, estimatedProgress: 0.1, readingProgress: 0.0, contentType: .webPage)
|
||||||
self.statePromise = Promise<BrowserContentState>(self._state)
|
self.statePromise = Promise<BrowserContentState>(self._state)
|
||||||
|
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
@ -725,7 +725,12 @@ final class BrowserWebContent: UIView, BrowserContent, WKNavigationDelegate, WKU
|
|||||||
}
|
}
|
||||||
|
|
||||||
func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) {
|
func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) {
|
||||||
self.currentError = nil
|
if let _ = self.currentError {
|
||||||
|
self.currentError = nil
|
||||||
|
if let (size, insets, fullInsets, safeInsets) = self.validLayout {
|
||||||
|
self.updateLayout(size: size, insets: insets, fullInsets: fullInsets, safeInsets: safeInsets, transition: .immediate)
|
||||||
|
}
|
||||||
|
}
|
||||||
self.updateFontState(self.currentFontState, force: true)
|
self.updateFontState(self.currentFontState, force: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ private final class SheetContent: CombinedComponent {
|
|||||||
|
|
||||||
let explicitLink = explicitUrl(context.component.link)
|
let explicitLink = explicitUrl(context.component.link)
|
||||||
var isValidLink = false
|
var isValidLink = false
|
||||||
if isValidUrl(explicitLink) {
|
if isValidUrl(explicitLink, validSchemes: ["http": true, "https": true, "tonsite": true]) {
|
||||||
isValidLink = true
|
isValidLink = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -735,8 +735,22 @@ public final class TelegramRootController: NavigationController, TelegramRootCon
|
|||||||
//Xcode 16
|
//Xcode 16
|
||||||
#if canImport(ContactProvider)
|
#if canImport(ContactProvider)
|
||||||
extension MediaEditorScreen.Result: @retroactive MediaEditorScreenResult {
|
extension MediaEditorScreen.Result: @retroactive MediaEditorScreenResult {
|
||||||
|
public var target: Stories.PendingTarget {
|
||||||
|
if let sendAsPeerId = self.options.sendAsPeerId {
|
||||||
|
return .peer(sendAsPeerId)
|
||||||
|
} else {
|
||||||
|
return .myStories
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
extension MediaEditorScreen.Result: MediaEditorScreenResult {
|
extension MediaEditorScreen.Result: MediaEditorScreenResult {
|
||||||
|
public var target: Stories.PendingTarget {
|
||||||
|
if let sendAsPeerId = self.options.sendAsPeerId {
|
||||||
|
return .peer(sendAsPeerId)
|
||||||
|
} else {
|
||||||
|
return .myStories
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1164,15 +1164,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
|||||||
transitionOut: nil
|
transitionOut: nil
|
||||||
)
|
)
|
||||||
let controller = self.context.sharedContext.makeStoryMediaEditorScreen(context: self.context, source: source, text: text, link: linkUrl.flatMap { ($0, linkName) }, completion: { result, commit in
|
let controller = self.context.sharedContext.makeStoryMediaEditorScreen(context: self.context, source: source, text: text, link: linkUrl.flatMap { ($0, linkName) }, completion: { result, commit in
|
||||||
// let targetPeerId: EnginePeer.Id
|
let target: Stories.PendingTarget = result.target
|
||||||
let target: Stories.PendingTarget
|
|
||||||
// if let sendAsPeerId = result.options.sendAsPeerId {
|
|
||||||
// target = .peer(sendAsPeerId)
|
|
||||||
// targetPeerId = sendAsPeerId
|
|
||||||
// } else {
|
|
||||||
target = .myStories
|
|
||||||
// targetPeerId = self.context.account.peerId
|
|
||||||
// }
|
|
||||||
externalState.storyTarget = target
|
externalState.storyTarget = target
|
||||||
|
|
||||||
if let rootController = self.context.sharedContext.mainWindow?.viewController as? TelegramRootControllerInterface {
|
if let rootController = self.context.sharedContext.mainWindow?.viewController as? TelegramRootControllerInterface {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user