mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-14 14:10:56 +00:00
fix wrong condition of local note
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.houxg.leamonax.model;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.elvishew.xlog.XLog;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.raizlabs.android.dbflow.annotation.Column;
|
||||
@@ -193,6 +195,14 @@ public class Note extends BaseModel implements Serializable {
|
||||
return tagData;
|
||||
}
|
||||
|
||||
public boolean isTotalEmpty() {
|
||||
return TextUtils.isEmpty(title) && TextUtils.isEmpty(content);
|
||||
}
|
||||
|
||||
public boolean isLocalNote() {
|
||||
return TextUtils.isEmpty(noteId);
|
||||
}
|
||||
|
||||
public void updateTags() {
|
||||
if (CollectionUtils.isEmpty(tagData)) {
|
||||
tags = "";
|
||||
|
@@ -204,7 +204,7 @@ public class NoteService {
|
||||
Map<String, RequestBody> requestBodyMap = generateCommonBodyMap(modifiedNote);
|
||||
List<MultipartBody.Part> fileBodies = handleFileBodies(modifiedNote, requestBodyMap);
|
||||
Call<Note> call;
|
||||
if (modifiedNote.getUsn() == 0) {
|
||||
if (modifiedNote.isLocalNote()) {
|
||||
call = ApiProvider.getInstance().getNoteApi().add(requestBodyMap, fileBodies);
|
||||
} else {
|
||||
Note remoteNote = RetrofitUtils.excuteWithException(getNoteByServerId(modifiedNote.getNoteId()));
|
||||
|
Reference in New Issue
Block a user