Skip to content

Commit

Permalink
fix: App favorites list view bug
Browse files Browse the repository at this point in the history
  • Loading branch information
iHTCboy committed Jun 24, 2023
1 parent 39423f3 commit 56a997b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion iAppStore/components/rankLists/AppDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ struct AppDetailView: View {
}
})
.sheet(isPresented: $isShowingQRCode) {
QRCodeView(title: "扫一扫下载", subTitle: "App Store 上的“\(item?.imName.label ?? "")", qrCodeContent: item?.id.label ?? "error", isShowingQRCode: $isShowingQRCode)
QRCodeView(title: "扫一扫下载",
subTitle: "App Store 上的“\(item?.imName.label ?? appModel.app?.trackName ?? "")",
qrCodeContent: item?.id.label ?? appModel.app?.trackViewUrl ?? "error",
isShowingQRCode: $isShowingQRCode)
}
.onAppear {
isAppFavorites = AppFavoritesModel.shared.search(appId) != nil
Expand Down
3 changes: 2 additions & 1 deletion iAppStore/components/setting/AppFavoritesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ struct AppFavoritesView: View {
List {
ForEach(appModel.results, id: \.trackId) { item in
let index = appModel.results.firstIndex { $0.trackId == item.trackId }
NavigationLink(destination: AppDetailView(appId: String(item.trackId), regionName: "中国", item: nil)) {
let app = AppFavoritesModel.shared.search("\(item.trackId)")
NavigationLink(destination: AppDetailView(appId: String(item.trackId), regionName: (app?.regionName ?? "中国"), item: nil)) {
SearchCellView(index: index ?? 0, item: item).frame(height: 110)
}
}
Expand Down

0 comments on commit 56a997b

Please sign in to comment.