wishkit / wishkit-ios

In-App Feature Requests. Made Easy.
https://wishkit.io
MIT License
133 stars 24 forks source link

In iOS 17, list is not updated after fetchList when push WishKit.view to NavigationStack. #36

Closed kwanghyun-two closed 2 months ago

kwanghyun-two commented 10 months ago

Hi, me again.

I'm not sure that we had this issue with iOS 16 or not. But, in iOS 17, List is not presenting when the WishKit.view is pushed into NavigationStack.

wishModel.fetchList is succeed when it is triggered by WishlistViewIOS.onAppear. But, any status changes: isLoading, hasFetched, approvedWishlist and implementedWishlist do not trigger WishKit.view update.

As a result, the UI is empty. Only after manual pull to refresh, the list is shown.

Thank you.

martinlasek commented 8 months ago

Hey @kwanghyun-two do you still see this issue today? Would you be able to provide:

I am trying to reproduce it on my end. So far the list was always showing up. But I'd love to cover the edge case since this is not the user experience I'd want for your users!

erenberkaydinc commented 4 months ago

@kwanghyun-two this solution worked for me!

NavigationLink {
                        FeatureRequestsView()
                    } label: {
                                Text("Feature Requests")
                        }
                    }
struct FeatureRequestsView: View {
    var body: some View {
        WishKit.view
    }
}
latishab commented 3 months ago

Hey @kwanghyun-two do you still see this issue today? Would you be able to provide:

  • WishKit version
  • iOS Version
  • iPhone

I am trying to reproduce it on my end. So far the list was always showing up. But I'd love to cover the edge case since this is not the user experience I'd want for your users!

I figured out the list has to be manually refresh in order to appear if you don't use the view under a navigationLink. I think it would be cool if you provide a refresh function for WishKit so that I am able to call the function through onAppear {}

latishab commented 3 months ago

hi, why is there no update on this yet

martinlasek commented 2 months ago

I was able to reproduce it and it seems to only happen when you also have an .onReceive modifier present in the view. As @erenberkaydinc mentioned there's a simple workaround until I find a fix for this bug.

Simply wrap the WishKit.view in a container view and use that container view instead:

/// Container View
struct FeedbackContainerView: View {
    var body: some View {
        WishKit.view
    }
}

// Your App
struct SettingsView: View {
    var body: some View {
        VStack {
            ...

            NavigationLink {
                FeedbackContainerView()
            } label: {
                Text("Feature Requests")
            }
        }
    }
}

Hope this helps!

martinlasek commented 2 months ago

Fixed with version 4.2.0 by deprecating WishKit.view and introducing WishKit.FeedbackListView().