mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-24 05:46:14 +03:00
Fix #1272 Notes created via Android's "Share Link" feature are not synced
Signed-off-by: Stefan Niedermann <info@niedermann.it>
This commit is contained in:
parent
220bc52cc4
commit
95afd472ce
3 changed files with 21 additions and 9 deletions
|
@ -114,9 +114,9 @@ public abstract class BaseNoteFragment extends BrandedFragment implements Catego
|
||||||
requireActivity().runOnUiThread(() -> onNoteLoaded(note));
|
requireActivity().runOnUiThread(() -> onNoteLoaded(note));
|
||||||
requireActivity().invalidateOptionsMenu();
|
requireActivity().invalidateOptionsMenu();
|
||||||
} else {
|
} else {
|
||||||
final var cloudNote = (Note) requireArguments().getSerializable(PARAM_NEWNOTE);
|
final var paramNote = (Note) requireArguments().getSerializable(PARAM_NEWNOTE);
|
||||||
final var content = requireArguments().getString(PARAM_CONTENT);
|
final var content = requireArguments().getString(PARAM_CONTENT);
|
||||||
if (cloudNote == null) {
|
if (paramNote == null) {
|
||||||
if (content == null) {
|
if (content == null) {
|
||||||
throw new IllegalArgumentException(PARAM_NOTE_ID + " is not given, argument " + PARAM_NEWNOTE + " is missing and " + PARAM_CONTENT + " is missing.");
|
throw new IllegalArgumentException(PARAM_NOTE_ID + " is not given, argument " + PARAM_NEWNOTE + " is missing and " + PARAM_CONTENT + " is missing.");
|
||||||
} else {
|
} else {
|
||||||
|
@ -125,7 +125,8 @@ public abstract class BaseNoteFragment extends BrandedFragment implements Catego
|
||||||
requireActivity().invalidateOptionsMenu();
|
requireActivity().invalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
note = repo.addNote(localAccount.getId(), cloudNote);
|
paramNote.setStatus(DBStatus.LOCAL_EDITED);
|
||||||
|
note = repo.addNote(localAccount.getId(), paramNote);
|
||||||
originalNote = null;
|
originalNote = null;
|
||||||
requireActivity().runOnUiThread(() -> onNoteLoaded(note));
|
requireActivity().runOnUiThread(() -> onNoteLoaded(note));
|
||||||
requireActivity().invalidateOptionsMenu();
|
requireActivity().invalidateOptionsMenu();
|
||||||
|
|
|
@ -423,7 +423,6 @@ public class NotesRepository {
|
||||||
@NonNull
|
@NonNull
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
public Note addNote(long accountId, @NonNull Note note) {
|
public Note addNote(long accountId, @NonNull Note note) {
|
||||||
note.setStatus(note.getId() > 0 ? DBStatus.LOCAL_EDITED : DBStatus.VOID);
|
|
||||||
note.setAccountId(accountId);
|
note.setAccountId(accountId);
|
||||||
note.setExcerpt(generateNoteExcerpt(note.getContent(), note.getTitle()));
|
note.setExcerpt(generateNoteExcerpt(note.getContent(), note.getTitle()));
|
||||||
return db.getNoteDao().getNoteById(db.getNoteDao().addNote(note));
|
return db.getNoteDao().getNoteById(db.getNoteDao().addNote(note));
|
||||||
|
@ -432,12 +431,9 @@ public class NotesRepository {
|
||||||
@MainThread
|
@MainThread
|
||||||
public LiveData<Note> moveNoteToAnotherAccount(Account account, @NonNull Note note) {
|
public LiveData<Note> moveNoteToAnotherAccount(Account account, @NonNull Note note) {
|
||||||
final var fullNote = new Note(null, note.getModified(), note.getTitle(), note.getContent(), note.getCategory(), note.getFavorite(), null);
|
final var fullNote = new Note(null, note.getModified(), note.getTitle(), note.getContent(), note.getCategory(), note.getFavorite(), null);
|
||||||
|
fullNote.setStatus(DBStatus.LOCAL_EDITED);
|
||||||
deleteNoteAndSync(account, note.getId());
|
deleteNoteAndSync(account, note.getId());
|
||||||
return map(addNoteAndSync(account, fullNote), (createdNote) -> {
|
return addNoteAndSync(account, fullNote);
|
||||||
db.getNoteDao().updateStatus(createdNote.getId(), DBStatus.LOCAL_EDITED);
|
|
||||||
createdNote.setStatus(DBStatus.LOCAL_EDITED);
|
|
||||||
return createdNote;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
15
fastlane/metadata/android/en-US/changelogs/3004014.txt
Normal file
15
fastlane/metadata/android/en-US/changelogs/3004014.txt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
3.4.14
|
||||||
|
|
||||||
|
- 🐞 Notes created via Android's "Share Link" feature are not synced (#1272)
|
||||||
|
|
||||||
|
3.4.13
|
||||||
|
|
||||||
|
- 🐞 Overflow-menu contains "search" when searchview is open (#522) by @vhouriet
|
||||||
|
- ✨ Enhance display of child/sub categories (#1154) by @ScottieKim
|
||||||
|
|
||||||
|
3.4.12
|
||||||
|
|
||||||
|
- 🐞 Fix potential crash when rendering a note with a checkbox (#1326) - by @pbek
|
||||||
|
- 🐞 Fix crash when long pressing a note and swiping to the edge of the screen (#1308)
|
||||||
|
- 🐞 Consistent timeouts when syncing (#761)
|
||||||
|
- 🐞 Categories created in web UI are not shown in Android app (#1358)
|
Loading…
Reference in a new issue