dsnallfot / LoopFollowiAPS

A general Follow app for parents of T1D Loop Users
GNU Affero General Public License v3.0
3 stars 0 forks source link

"DONE" buttons in settings don't work #65

Closed dsnallfot closed 7 months ago

dsnallfot commented 7 months ago

When adding remote to tab bar and pushing settings to "more" tab. Dismiss view linkage gets broken.

UI Kit navigation defaults to adding "back" button instead = This is a minor issue, but should of course be fixed before PR to official LF repo.

Also force unwrap crash when trying to enter infodisplaysettings. (Have fix for that in personal branch). Not 100% sure what breaks this, but work around is code to avoid force unwrapping.

Settings in more tab image

Default "back button" (that works). "DONE" button broken image

dsnallfot commented 7 months ago

Fixed in personal testing branch. To be PR:ed to dev-remote later.

This code:

        +++ ButtonRow() {
            $0.title = "DONE"
        }.onCellSelection { (row, arg)  in
            self.dismiss(animated:true, completion: nil)
        }

Replaced with this (allowing both modal and navigation entry points):

        +++ ButtonRow() {
            $0.title = "DONE"
        }.onCellSelection { (row, arg) in
            if let navigationController = self.navigationController {
                navigationController.popViewController(animated: true)
            } else {
                // If there's no navigation controller, dismiss the current view controller
                self.dismiss(animated: true, completion: nil)
            }
        }
dsnallfot commented 7 months ago

Fixed in PR #66