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

Fix Trello: "[iOS] Tidepool Mobile new note created during first time… #7

Merged
merged 1 commit into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ class EventAddEditViewController: BaseUIViewController, UITextViewDelegate {
if (messageBox.text != defaultMessage && !messageBox.text.isEmpty) {
APIConnector.connector().trackMetric("Clicked Post Note")

self.note.createdtime = Date()

// if messageBox has text (not default message or empty) --> set the note to have values
self.note.messagetext = self.messageBox.text
self.note.groupid = self.group.userid
Expand Down
5 changes: 4 additions & 1 deletion TidepoolMobile/ViewControllers/EventListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class EventListViewController: BaseUIViewController, ENSideMenuDelegate, NoteAPI
fileprivate var sortedNotes: [NoteInEventListTable] = []
fileprivate var filteredNotes: [NoteInEventListTable] = []
fileprivate var filterString = ""
var justPerformedUnwindToDoneAddNote = false
// Fetch all notes for now...
var loadingNotes = false

Expand Down Expand Up @@ -198,10 +199,11 @@ class EventListViewController: BaseUIViewController, ENSideMenuDelegate, NoteAPI
sideMenu.allowPanGesture = true
}

if sortedNotes.isEmpty || eventListNeedsUpdate {
if (sortedNotes.isEmpty || eventListNeedsUpdate) && !justPerformedUnwindToDoneAddNote {
eventListNeedsUpdate = false
loadNotes()
}
justPerformedUnwindToDoneAddNote = false

// periodically check for authentication issues in case we need to force a new login
let appDelegate = UIApplication.shared.delegate as? AppDelegate
Expand Down Expand Up @@ -672,6 +674,7 @@ class EventListViewController: BaseUIViewController, ENSideMenuDelegate, NoteAPI
} else {
DDLogInfo("Unknown segue source!")
}
justPerformedUnwindToDoneAddNote = true
}

// Save button from edit comment.
Expand Down