Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CreatePollView public or fix composerViewModel.pickerState = .polls only working once #684

Closed
f3dm76 opened this issue Dec 6, 2024 · 2 comments

Comments

@f3dm76
Copy link
Contributor

f3dm76 commented Dec 6, 2024

What are you trying to achieve?

I'm using a custom menu for attachments, like this:
simulator_screenshot_A4ED567C-267A-49E4-A367-F25C074E89E5
I'd like to reuse the picker views from inside SC library but use my own menu view.
Here is the code of my menu

@EnvironmentObject private var composerViewModel: MessageComposerViewModel

VStack(alignment: .leading, spacing: 25) {
  MenuItem(icon: "camera.circle.fill", text: "Camera") {
      composerViewModel.pickerState = .camera
  }
  MenuItem(icon: "photo.circle.fill", text: "Photos & Videos") {
      state.wrappedValue = .expanded(.media)
  }
  MenuItem(icon: "bolt.circle.fill", text: "Giphy") {
      composerViewModel.composerCommand = .init(
          id: "/giphy",
          typingSuggestion: .init(text: "", locationRange: NSRange(location: 0, length: 0)),
          displayInfo: CommandDisplayInfo(
              displayName: "Giphy",
              icon: UIImage(systemName: "circle")!,
              format: "/giphy [text]",
              isInstant: true
          )
      )
  }
  MenuItem(icon: "questionmark.circle.fill", text: "Poll") {
          composerViewModel.pickerState = .polls
  }
}

The problem: When I tap "polls" for the first time, it opens ok. When I close polls view, and tap "polls" again - nothing happens. It fixes itself if I open camera, and then the polls works again, but only once.

Could you maybe make CreatePollView public so I can control it myself making sure it works correctly? Or maybe could you change smth inside the lib to make composerViewModel.pickerState = .polls work stably?

If possible, how can you achieve this currently?

What would be the better way?

GetStream Environment

GetStream Chat version: 4.67.0
GetStream Chat frameworks: StreamChat, StreamChatUI
iOS version: 18.0
Swift version: 6.0
Xcode version: 16.0
Device: sim iPhone 16 pro max

Additional context

@laevandus
Copy link
Contributor

laevandus commented Dec 6, 2024

Hi @f3dm76, we discussed it and will be making CreatePollView public.

Thank you!

@testableapple
Copy link
Contributor

Hi @f3dm76, this has been released as part of 4.69.0 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants