diff --git a/Example/WalletApp/BusinessLayer/ListingsSertice/Listings.swift b/Example/WalletApp/BusinessLayer/ListingsSertice/Listings.swift index 4ab2673c9..276c56072 100644 --- a/Example/WalletApp/BusinessLayer/ListingsSertice/Listings.swift +++ b/Example/WalletApp/BusinessLayer/ListingsSertice/Listings.swift @@ -17,4 +17,7 @@ struct Listing: Codable { let homepage: String? let image_url: ImageURL? let dapp_url: String + let order: Int? + let is_verified: Bool + let is_featured: Bool } diff --git a/Example/WalletApp/BusinessLayer/ListingsSertice/ListingsAPI.swift b/Example/WalletApp/BusinessLayer/ListingsSertice/ListingsAPI.swift index 8e3700db7..c121e1e38 100644 --- a/Example/WalletApp/BusinessLayer/ListingsSertice/ListingsAPI.swift +++ b/Example/WalletApp/BusinessLayer/ListingsSertice/ListingsAPI.swift @@ -16,7 +16,7 @@ enum ListingsAPI: HTTPService { } var queryParameters: [String : String]? { - return ["projectId": InputConfig.projectId, "entries": "100", "is_verified": "false"] + return ["projectId": InputConfig.projectId, "entries": "100"] } var additionalHeaderFields: [String : String]? { diff --git a/Example/WalletApp/PresentationLayer/Wallet/Notifications/Models/ListingViewModel.swift b/Example/WalletApp/PresentationLayer/Wallet/Notifications/Models/ListingViewModel.swift index 08286926d..f74194ff0 100644 --- a/Example/WalletApp/PresentationLayer/Wallet/Notifications/Models/ListingViewModel.swift +++ b/Example/WalletApp/PresentationLayer/Wallet/Notifications/Models/ListingViewModel.swift @@ -24,4 +24,8 @@ struct ListingViewModel: Identifiable { let url = listing.dapp_url return URL(string: url)?.host } + + var order: Int { + return listing.order ?? 10000 + } } diff --git a/Example/WalletApp/PresentationLayer/Wallet/Notifications/NotificationsPresenter.swift b/Example/WalletApp/PresentationLayer/Wallet/Notifications/NotificationsPresenter.swift index 91a573857..6bf09eda2 100644 --- a/Example/WalletApp/PresentationLayer/Wallet/Notifications/NotificationsPresenter.swift +++ b/Example/WalletApp/PresentationLayer/Wallet/Notifications/NotificationsPresenter.swift @@ -23,8 +23,9 @@ final class NotificationsPresenter: ObservableObject { var listingViewModels: [ListingViewModel] { return listings .map { ListingViewModel(listing: $0) } - .sorted(by: + .sorted(by: { subscription(forListing: $0) != nil && subscription(forListing: $1) == nil }, + { $0.order < $1.order }, { $0.title < $1.title } ) }