Various fixes

This commit is contained in:
Ilya Laktyushin 2024-07-26 14:11:25 +02:00
parent fd63e83d6e
commit 9975f939ce
4 changed files with 19 additions and 11 deletions

View File

@ -12564,6 +12564,7 @@ Sorry for the inconvenience.";
"WebBrowser.AddressBar.RecentlyVisited.Clear" = "Clear";
"WebBrowser.AddressBar.Bookmarks" = "BOOKMARKS";
"WebBrowser.AddressBar.ShowMore" = "Show More";
"WebBrowser.OpenLinksIn.Title" = "OPEN LINKS IN";
"WebBrowser.AutoLogin" = "Auto-Login via Telegram";
@ -12656,3 +12657,6 @@ Sorry for the inconvenience.";
"WebBrowser.CopyLink" = "Copy Link";
"WebBrowser.DeleteBookmark" = "Delete Bookmark";
"WebBrowser.RemoveRecent" = "Remove from Recent";
"Stars.Intro.Transaction.Gift.Title" = "Received Gift";
"Stars.Intro.Transaction.Gift.UnknownUser" = "Unknown User";

View File

@ -235,9 +235,9 @@ final class BrowserAddressListComponent: Component {
let sectionTitle: String
if section.id == 0 {
sectionTitle = "RECENTLY VISITED"
sectionTitle = component.strings.WebBrowser_AddressBar_RecentlyVisited
} else if section.id == 1 {
sectionTitle = "BOOKMARKS"
sectionTitle = component.strings.WebBrowser_AddressBar_Bookmarks
} else {
sectionTitle = ""
}
@ -249,7 +249,7 @@ final class BrowserAddressListComponent: Component {
style: .plain,
title: sectionTitle,
insets: component.insets,
actionTitle: section.id == 0 ? "Clear" : nil,
actionTitle: section.id == 0 ? component.strings.WebBrowser_AddressBar_RecentlyVisited_Clear : nil,
action: { [weak self] in
if let self, let component = self.component {
let _ = clearRecentlyVisitedLinks(engine: component.context.engine).start()
@ -279,11 +279,11 @@ final class BrowserAddressListComponent: Component {
continue
}
var id = 0
var id: String = ""
if section.id == 0 {
id += i
id = "recent_\(state.recent[i].content.url ?? "")"
} else if section.id == 1 {
id += 1000 + i
id = "bookmark_\(state.bookmarks[i].id.id)"
}
let itemId = AnyHashable(id)
@ -458,11 +458,12 @@ final class BrowserAddressListComponent: Component {
bookmarks.append(entry.message)
}
let isFirstTime = self.stateValue == nil
self.stateValue = State(
recent: recent,
bookmarks: bookmarks
)
self.state?.updated(transition: .immediate)
self.state?.updated(transition: isFirstTime ? .immediate : .easeInOut(duration: 0.25))
})
}

View File

@ -116,6 +116,10 @@ final class BrowserAddressListItemComponent: Component {
self.containerButton.clipsToBounds = value
self.containerButton.backgroundColor = value ? component.theme.list.plainBackgroundColor : nil
self.containerButton.layer.cornerRadius = value ? 10.0 : 0.0
if value {
self.highlightedBackgroundLayer.opacity = 0.0
}
}
self.extractedContainerView.willUpdateIsExtractedToContextPreview = { [weak self] value, transition in
guard let self else {

View File

@ -218,8 +218,7 @@ final class StarsTransactionsListPanelComponent: Component {
} else {
itemTitle = peer.displayTitle(strings: environment.strings, displayOrder: .firstLast)
if item.flags.contains(.isGift) {
//TODO:localize
itemSubtitle = "Received Gift"
itemSubtitle = environment.strings.Stars_Intro_Transaction_Gift_Title
} else {
itemSubtitle = nil
}
@ -233,8 +232,8 @@ final class StarsTransactionsListPanelComponent: Component {
case .fragment:
if component.isAccount {
if item.flags.contains(.isGift) {
itemTitle = "Unknown User"
itemSubtitle = "Received Gift"
itemTitle = environment.strings.Stars_Intro_Transaction_Gift_UnknownUser
itemSubtitle = environment.strings.Stars_Intro_Transaction_Gift_Title
itemPeer = .fragment
} else {
itemTitle = environment.strings.Stars_Intro_Transaction_FragmentTopUp_Title