Skip to content

Commit

Permalink
Fix #2
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
  • Loading branch information
franciscofranco committed Mar 18, 2016
1 parent 7333992 commit 891f7c0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import liam.franco.selene.bus.NoteUpdatingEvent;
import liam.franco.selene.modules.Note;
import liam.franco.selene.ui.NoteItem;
import liam.franco.selene.utils.GaiaUtils;
import liam.franco.selene.utils.RecyclerViewUtils;

public class SuperSheetsFragment extends Fragment {
Expand Down Expand Up @@ -178,6 +179,14 @@ public void noteDeleted(NoteDeleted note) {
if (note.getDeletedNote().getUid() ==
getAdapter().getAdapterItem(i).getViewHolder().getNote().getUid()) {
getAdapter().remove(i);

// we gotta clean this note from Gaia otherwise it'll create havoc
// not super pretty looking code, but gets the job done!
String noteTitle = note.getDeletedNote().getTitle();
GaiaUtils.seekAndDestroy(noteTitle + "_" + GaiaUtils.NOTE_PARENT_LAYOUT);
GaiaUtils.seekAndDestroy(noteTitle + "_" + GaiaUtils.NOTE_TITLE);
GaiaUtils.seekAndDestroy(noteTitle + "_" + GaiaUtils.NOTE_CONTENT);

App.REALM.beginTransaction();
note.getDeletedNote().removeFromRealm();
App.REALM.commitTransaction();
Expand Down

0 comments on commit 891f7c0

Please sign in to comment.