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

Upload of profile data to NS does not happen when main settings is closed by swipe down, only when tapping "Close" #260

Closed
bjornoleh opened this issue Oct 20, 2023 · 4 comments

Comments

@bjornoleh
Copy link
Contributor

If I make a change to e.g DIA in iAPS Pump Settings, and Save on Pump, then go back to main settings screen and tap "Close" in upper left hand corner, the changed DIA gets uploaded to NS profiles.

However, if I instead after Save on Pump directly close Pump Settings by swiping down, or go to main settings and then swipe down, DIA is not uploaded to NS profiles. If I go back into main settings and tap "Close", the change is uploaded to NS.

The same holds for changes to ISF and CR.

We should check the condition that forces the upload. Obviously, tapping "Close" and swiping down is not the same in this context. Both should do the same, of course.

@bjornoleh
Copy link
Contributor Author

bjornoleh commented Oct 20, 2023

Settings are uploaded by the function

func hideSettingsModal() {
            nightscoutManager.uploadProfile()
            hideModal()
        }

func uploadProfile() {
NSLog("SettingsState Upload Profile")
nightscoutManager.uploadProfile()
}
func hideSettingsModal() {
nightscoutManager.uploadProfile()
hideModal()
}

This is activated by tapping the "Close" button in main settings view:

.navigationBarItems(leading: Button("Close", action: state.hideSettingsModal))

.navigationBarItems(leading: Button("Close", action: state.hideSettingsModal))

I suppose we need to make this happen with a swipe down too, or change the logic related to profile uploads.

@bjornoleh
Copy link
Contributor Author

bjornoleh commented Oct 20, 2023

In dev, the upload and hideSettingsModal function has been changed a bit:

func uploadProfileAndSettings() {
NSLog("SettingsState Upload Profile")
nightscoutManager.uploadProfileAndSettings()
}
func hideSettingsModal() {
nightscoutManager.uploadProfileAndSettings()
hideModal()

@bjornoleh
Copy link
Contributor Author

I had a look, but could not get the native swipe down action to upload settings. Will need to hand it over to someone else.

@Jon-b-m
Copy link
Member

Jon-b-m commented Oct 23, 2023

Fixed in dev!

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

2 participants