Skip to content

Commit

Permalink
Merge pull request #1241 from WalletConnect/feature/notify-dapps-order
Browse files Browse the repository at this point in the history
[Notify] Curate explorer listings
  • Loading branch information
flypaper0 authored Dec 4, 2023
2 parents 0bd41c6 + 6b6119a commit b57fe00
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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]? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ struct ListingViewModel: Identifiable {
let url = listing.dapp_url
return URL(string: url)?.host
}

var order: Int {
return listing.order ?? 10000
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
)
}
Expand Down

0 comments on commit b57fe00

Please sign in to comment.