diff --git a/submodules/AccountContext/Sources/AccountContext.swift b/submodules/AccountContext/Sources/AccountContext.swift index e8a808b9a0..54b8517ea9 100644 --- a/submodules/AccountContext/Sources/AccountContext.swift +++ b/submodules/AccountContext/Sources/AccountContext.swift @@ -755,7 +755,7 @@ public class MediaEditorTransitionOutExternalState { } public protocol MediaEditorScreenResult { - + var target: Stories.PendingTarget { get } } public protocol TelegramRootControllerInterface: NavigationController { diff --git a/submodules/BrowserUI/Sources/BrowserBookmarksScreen.swift b/submodules/BrowserUI/Sources/BrowserBookmarksScreen.swift index 64ec20912b..b77e831e36 100644 --- a/submodules/BrowserUI/Sources/BrowserBookmarksScreen.swift +++ b/submodules/BrowserUI/Sources/BrowserBookmarksScreen.swift @@ -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.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.searchContentNode = NavigationBarSearchContentNode(theme: self.presentationData.theme, placeholder: self.presentationData.strings.Common_Search, activate: { [weak self] in diff --git a/submodules/BrowserUI/Sources/BrowserScreen.swift b/submodules/BrowserUI/Sources/BrowserScreen.swift index c9ce6c8ed8..d5c664de3f 100644 --- a/submodules/BrowserUI/Sources/BrowserScreen.swift +++ b/submodules/BrowserUI/Sources/BrowserScreen.swift @@ -384,13 +384,13 @@ private final class BrowserScreenComponent: CombinedComponent { bottomInset: toolbarBottomInset, sideInset: environment.safeInsets.left, item: toolbarContent, - collapseFraction: collapseFraction + collapseFraction: 0.0 ), availableSize: context.availableSize, transition: context.transition ) 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 transition.animatePosition(view: view, from: CGPoint(x: 0.0, y: view.frame.height), to: CGPoint(), additive: true) }) diff --git a/submodules/BrowserUI/Sources/BrowserWebContent.swift b/submodules/BrowserUI/Sources/BrowserWebContent.swift index 0c0f883e0d..284ff9f527 100644 --- a/submodules/BrowserUI/Sources/BrowserWebContent.swift +++ b/submodules/BrowserUI/Sources/BrowserWebContent.swift @@ -244,7 +244,7 @@ final class BrowserWebContent: UIView, BrowserContent, WKNavigationDelegate, WKU 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(self._state) super.init(frame: .zero) @@ -725,7 +725,12 @@ final class BrowserWebContent: UIView, BrowserContent, WKNavigationDelegate, WKU } 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) } diff --git a/submodules/TelegramUI/Components/MediaEditorScreen/Sources/CreateLinkScreen.swift b/submodules/TelegramUI/Components/MediaEditorScreen/Sources/CreateLinkScreen.swift index 8b64da17ae..ec63761850 100644 --- a/submodules/TelegramUI/Components/MediaEditorScreen/Sources/CreateLinkScreen.swift +++ b/submodules/TelegramUI/Components/MediaEditorScreen/Sources/CreateLinkScreen.swift @@ -120,7 +120,7 @@ private final class SheetContent: CombinedComponent { let explicitLink = explicitUrl(context.component.link) var isValidLink = false - if isValidUrl(explicitLink) { + if isValidUrl(explicitLink, validSchemes: ["http": true, "https": true, "tonsite": true]) { isValidLink = true } diff --git a/submodules/TelegramUI/Sources/TelegramRootController.swift b/submodules/TelegramUI/Sources/TelegramRootController.swift index a450ca906a..291257a38b 100644 --- a/submodules/TelegramUI/Sources/TelegramRootController.swift +++ b/submodules/TelegramUI/Sources/TelegramRootController.swift @@ -735,8 +735,22 @@ public final class TelegramRootController: NavigationController, TelegramRootCon //Xcode 16 #if canImport(ContactProvider) extension MediaEditorScreen.Result: @retroactive MediaEditorScreenResult { + public var target: Stories.PendingTarget { + if let sendAsPeerId = self.options.sendAsPeerId { + return .peer(sendAsPeerId) + } else { + return .myStories + } + } } #else extension MediaEditorScreen.Result: MediaEditorScreenResult { + public var target: Stories.PendingTarget { + if let sendAsPeerId = self.options.sendAsPeerId { + return .peer(sendAsPeerId) + } else { + return .myStories + } + } } #endif diff --git a/submodules/WebUI/Sources/WebAppController.swift b/submodules/WebUI/Sources/WebAppController.swift index 9b32c4a186..2bb881c944 100644 --- a/submodules/WebUI/Sources/WebAppController.swift +++ b/submodules/WebUI/Sources/WebAppController.swift @@ -1164,15 +1164,7 @@ public final class WebAppController: ViewController, AttachmentContainable { 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 targetPeerId: EnginePeer.Id - let target: Stories.PendingTarget -// if let sendAsPeerId = result.options.sendAsPeerId { -// target = .peer(sendAsPeerId) -// targetPeerId = sendAsPeerId -// } else { - target = .myStories -// targetPeerId = self.context.account.peerId -// } + let target: Stories.PendingTarget = result.target externalState.storyTarget = target if let rootController = self.context.sharedContext.mainWindow?.viewController as? TelegramRootControllerInterface {