From daeecf809beee974a975f93349a3e2fbc80a95a2 Mon Sep 17 00:00:00 2001 From: Kyle Hickinson Date: Wed, 22 Jan 2025 15:07:03 -0500 Subject: [PATCH] [iOS] Improve check for YouTube favourite in new onboarding popup --- .../Browser/New Tab Page/NewTabPageViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/NewTabPageViewController.swift b/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/NewTabPageViewController.swift index fd17801124d1..e80ec2cf0143 100644 --- a/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/NewTabPageViewController.swift +++ b/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/NewTabPageViewController.swift @@ -130,7 +130,9 @@ class NewTabPageViewController: UIViewController { frc.fetchRequest.fetchLimit = 5 try? frc.performFetch() guard let section = sections.firstIndex(where: { $0 is FavoritesSectionProvider }), - let item = frc.fetchedObjects?.firstIndex(where: { $0.url == "https://m.youtube.com" }), + let item = frc.fetchedObjects?.firstIndex(where: { + $0.url.flatMap(URL.init(string:))?.baseDomain == "youtube.com" + }), let cell = collectionView.cellForItem(at: .init(item: item, section: section)) else { return nil