mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-02 12:47:41 +02:00
This commit is contained in:
parent
9fb104ec7c
commit
1fca7eddcb
@ -387,7 +387,7 @@ describe('models/Note', () => {
|
|||||||
expect(conflictedNote.conflict_original_id).toBe(origNote.id);
|
expect(conflictedNote.conflict_original_id).toBe(origNote.id);
|
||||||
expect(conflictedNote.parent_id).toBe(folder.id);
|
expect(conflictedNote.parent_id).toBe(folder.id);
|
||||||
expect(conflictedNote.is_shared).toBeUndefined();
|
expect(conflictedNote.is_shared).toBeUndefined();
|
||||||
expect(conflictedNote.share_id).toBeUndefined();
|
expect(conflictedNote.share_id).toBe('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should copy conflicted note to target folder and cancel conflict', (async () => {
|
it('should copy conflicted note to target folder and cancel conflict', (async () => {
|
||||||
|
@ -828,9 +828,15 @@ export default class Note extends BaseItem {
|
|||||||
void ItemChange.add(BaseModel.TYPE_NOTE, savedNote.id, isNew ? ItemChange.TYPE_CREATE : ItemChange.TYPE_UPDATE, changeSource, beforeNoteJson);
|
void ItemChange.add(BaseModel.TYPE_NOTE, savedNote.id, isNew ? ItemChange.TYPE_CREATE : ItemChange.TYPE_UPDATE, changeSource, beforeNoteJson);
|
||||||
|
|
||||||
if (dispatchUpdateAction) {
|
if (dispatchUpdateAction) {
|
||||||
|
// The UI requires share_id -- if a new note, it will always be the empty string in the database
|
||||||
|
// until processed by the share service. At present, loading savedNote from the database in this case
|
||||||
|
// breaks tests.
|
||||||
|
if (!('share_id' in savedNote) && isNew) {
|
||||||
|
savedNote.share_id = '';
|
||||||
|
}
|
||||||
// Ensures that any note added to the state has all the required
|
// Ensures that any note added to the state has all the required
|
||||||
// properties for the UI to work.
|
// properties for the UI to work.
|
||||||
if (!('deleted_time' in savedNote)) {
|
if (!('deleted_time' in savedNote) || !('share_id' in savedNote)) {
|
||||||
const fields = removeElement(unique(this.previewFields().concat(Object.keys(savedNote))), 'type_');
|
const fields = removeElement(unique(this.previewFields().concat(Object.keys(savedNote))), 'type_');
|
||||||
savedNote = await this.load(savedNote.id, {
|
savedNote = await this.load(savedNote.id, {
|
||||||
fields,
|
fields,
|
||||||
|
Loading…
Reference in New Issue
Block a user