Skip to content

Commit

Permalink
fix: Unexpectedly navigate back to detail
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuz0u committed May 23, 2021
1 parent 12f6c6f commit 7393f6f
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions EhPanda/View/Content/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ import SDWebImageSwiftUI
struct ContentView: View, StoreAccessor {
@EnvironmentObject var store: Store

@State private var geoTimer = Timer.publish(
every: 0.5, on: .current, in: .common
)
.autoconnect()

@State private var position: CGFloat = 0
@State private var aspectBox = [Int: CGFloat]()

Expand Down Expand Up @@ -58,11 +53,10 @@ struct ContentView: View, StoreAccessor {
ScrollView {
GeometryReader { geoProxy in
Text("I'm invisible~")
.onReceive(geoTimer) { _ in
updateGeoProxyMinY(
geoProxy.frame(in: .global).minY
)
}
.onChange(
of: geoProxy.frame(in: .global).minY,
perform: updateGeoProxyMinY
)
}
.frame(width: 0, height: 0)
LazyVStack(spacing: 0) {
Expand All @@ -73,10 +67,7 @@ struct ContentView: View, StoreAccessor {
retryLimit: setting.contentRetryLimit,
onSuccessAction: onWebImageSuccess
)
.frame(
width: screenW,
height: calImageHeight(item.tag)
)
.frame(height: calImageHeight(item.tag))
.onAppear {
onWebImageAppear(item)
}
Expand Down

0 comments on commit 7393f6f

Please sign in to comment.