mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-19 00:44:08 +00:00
Fix when update note createdTime or publicTime field content error
This commit is contained in:
@@ -270,6 +270,16 @@ public class NoteService {
|
|||||||
note.setContent(modifiedNote.getContent());
|
note.setContent(modifiedNote.getContent());
|
||||||
handleFile(modifiedNote.getId(), note.getNoteFiles());
|
handleFile(modifiedNote.getId(), note.getNoteFiles());
|
||||||
updateTagsToLocal(modifiedNote.getId(), note.getTagData());
|
updateTagsToLocal(modifiedNote.getId(), note.getTagData());
|
||||||
|
if (!modifiedNote.isLocalNote()) {//noteId已经存在,代表是更新操作,服务端updateNote接口存在bug,所以特殊处理下createdTime, publicTime
|
||||||
|
if (modifiedNote.getCreatedTimeVal() == -62135596800000L || modifiedNote.getPublicTimeVal() == -62135596800000L) {
|
||||||
|
Note remoteNote = RetrofitUtils.excuteWithException(ApiProvider.getInstance().getNoteApi().getNoteAndContent(modifiedNote.getNoteId()));
|
||||||
|
note.setCreatedTimeVal(remoteNote.getCreatedTimeVal());
|
||||||
|
note.setPublicTimeVal(remoteNote.getPublicTimeVal());
|
||||||
|
} else {
|
||||||
|
note.setCreatedTimeVal(modifiedNote.getCreatedTimeVal());
|
||||||
|
note.setPublicTimeVal(modifiedNote.getPublicTimeVal());
|
||||||
|
}
|
||||||
|
}
|
||||||
note.save();
|
note.save();
|
||||||
updateNoteUsnIfNeed(note.getUsn());
|
updateNoteUsnIfNeed(note.getUsn());
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user