kean / Pulse

Network logger for Apple platforms
https://pulselogger.com
MIT License
6.25k stars 296 forks source link

Two "Close" buttons in Console #183

Closed OneSman7 closed 1 year ago

OneSman7 commented 1 year ago

I just updated to the recent version (3.5.4 -> 3.5.7) and see this in Console)) I think screenshot says it all :D It does not prevent from using console - both buttons work.

photo_2023-04-13 19 08 33

kean commented 1 year ago

Hey, thanks for the report. Can you the code that shows the console please?

OneSman7 commented 1 year ago
func presentPulseLogging(on controller: UIViewController) {

        let vc = PulseUI.MainViewController(store: .shared) { [weak controller] in
            controller?.dismiss(animated: true, completion: nil)
        }

        vc.modalPresentationStyle = .fullScreen

        controller.present(vc, animated: true, completion: nil)
    }
OneSman7 commented 1 year ago

It seems 2 buttons come from here

Снимок экрана 2023-04-13 в 21 11 47
OneSman7 commented 1 year ago

It was needed previously to provide onDismiss to close console correctly. Seems now it is not necessary and results in 2 buttons :)

kean commented 1 year ago

Yes, you can remove onDismiss for now as a workaround. I'm going to update the API in the upcoming release.

kean commented 1 year ago

Fixed in 3.6.0.

OneSman7 commented 1 year ago

Hello again! Now on iOS 14 no close button is displayed. Will have to resort to display console not fullscreen to be able to close it. Maybe it is connected to @Environment(.presentationMode) being debrecated, but I am not sure.

kean commented 1 year ago

I don't know; this API has been hit or miss. In my testing, it works, but it depends on how you present it and what View/ViewController hierarchy.

The expected behavior is that it should be displayed by default. I would appreciate it if you could provide a sample where I can reproduce it.