1
0
mirror of https://github.com/etesync/android synced 2025-02-02 10:51:10 +00:00

Create collection: only update url after pushed to server.

Without this change, if the putting on server of a new collection fails,
the url would already be updated, and since having a url indicates it
exists on the server, trying to save it later would result in a 404.
This commit is contained in:
Tom Hacohen 2017-03-08 16:15:16 +00:00
parent 32df64000f
commit f84bd386f1

View File

@ -153,8 +153,8 @@ public class CreateCollectionFragment extends DialogFragment implements LoaderMa
if (info.url == null) {
// CollectionInfo doesn't have a url at this point, update it.
JournalManager.Journal journal = new JournalManager.Journal(settings.password(), info.toJson());
info.url = journal.getUuid();
journalManager.putJournal(journal);
info.url = journal.getUuid();
} else {
JournalManager.Journal journal = new JournalManager.Journal(settings.password(), info.toJson(), info.url);
journalManager.updateJournal(journal);