mirror of
https://github.com/etesync/android
synced 2024-11-16 04:49:06 +00:00
Collection deletion: mark as deleted in cache, but don't actually delete.
This is important for protecting against potential data loss.
This commit is contained in:
parent
ba9f217d66
commit
3a83cf8303
@ -120,7 +120,9 @@ public class DeleteCollectionFragment extends DialogFragment implements LoaderMa
|
||||
|
||||
JournalManager journalManager = new JournalManager(HttpClient.create(getContext(), account), principal);
|
||||
journalManager.deleteJournal(new JournalManager.Journal(settings.password(), collectionInfo.toJson(), collectionInfo.url));
|
||||
data.delete(JournalEntity.fetch(data, collectionInfo.url));
|
||||
JournalEntity journalEntity = JournalEntity.fetch(data, collectionInfo.url);
|
||||
journalEntity.setDeleted(true);
|
||||
data.update(journalEntity);
|
||||
|
||||
return null;
|
||||
} catch (Exceptions.HttpException e) {
|
||||
|
@ -57,7 +57,7 @@ public class ViewCollectionActivity extends AppCompatActivity implements Refresh
|
||||
int entryCount = -1;
|
||||
|
||||
final JournalEntity journalEntity = JournalEntity.fetch(data, info.url);
|
||||
if (journalEntity == null) {
|
||||
if ((journalEntity == null) || journalEntity.isDeleted()) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user