Always provide the attribute \'modified\' when creating or modifying a note to allow the API to handle conflicts
This commit is contained in:
parent
52132195a5
commit
f7bc0ed9b8
3 changed files with 4 additions and 4 deletions
|
@ -16,7 +16,7 @@ Dialog {
|
||||||
property string errorMessage
|
property string errorMessage
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
notesApi.updateNote(id, { 'category': categoryField.text, 'content': contentArea.text, 'favorite': favoriteButton.selected } )
|
notesApi.updateNote(id, { 'category': categoryField.text, 'content': contentArea.text, 'favorite': favoriteButton.selected, 'modified': new Date().valueOf() / 1000 } )
|
||||||
}
|
}
|
||||||
|
|
||||||
function reloadContent() {
|
function reloadContent() {
|
||||||
|
|
|
@ -119,8 +119,8 @@ Dialog {
|
||||||
MenuLabel {
|
MenuLabel {
|
||||||
visible: appSettings.currentAccount.length >= 0
|
visible: appSettings.currentAccount.length >= 0
|
||||||
text: qsTr("Last update") + ": " + (
|
text: qsTr("Last update") + ": " + (
|
||||||
new Date(notesApi.update).valueOf() !== 0 ?
|
new Date(account.update).valueOf() !== 0 ?
|
||||||
new Date(notesApi.update).toLocaleString(Qt.locale(), Locale.ShortFormat) :
|
new Date(account.update).toLocaleString(Qt.locale(), Locale.ShortFormat) :
|
||||||
qsTr("never"))
|
qsTr("never"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ Page {
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("Add note")
|
text: qsTr("Add note")
|
||||||
enabled: appSettings.currentAccount.length > 0
|
enabled: appSettings.currentAccount.length > 0
|
||||||
onClicked: notesApi.createNote( { 'content': "" } )
|
onClicked: notesApi.createNote( { 'content': "", 'modified': new Date().valueOf() / 1000 } )
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: enabled ? qsTr("Reload") : qsTr("Updating...")
|
text: enabled ? qsTr("Reload") : qsTr("Updating...")
|
||||||
|
|
Loading…
Reference in a new issue