Skip to content

Commit

Permalink
Version bumping, and adding a hotfix for notes getting accidentally t…
Browse files Browse the repository at this point in the history
…rashed.
  • Loading branch information
roundhill committed Jul 27, 2018
1 parent 9b4523b commit 5c64538
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
6 changes: 3 additions & 3 deletions Simplenote/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dependencies {
wearApp project(':Wear')
}

version "1.6.2"
version "1.6.3"

android {
testOptions {
Expand All @@ -74,7 +74,7 @@ android {
defaultConfig {
applicationId "com.automattic.simplenote"
versionName project.version
versionCode 65
versionCode 66
minSdkVersion 16
targetSdkVersion 26

Expand All @@ -98,7 +98,7 @@ android {
}

debug {
applicationIdSuffix '.debug'
//applicationIdSuffix '.debug'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void run() {
private Handler mHistoryTimeoutHandler;
private LinearLayout mPlaceholderView;
private CursorAdapter mAutocompleteAdapter;
private boolean mIsLoadingNote, mIsMarkdownEnabled, mTextDidChange;
private boolean mIsLoadingNote, mIsMarkdownEnabled;
private ActionMode mActionMode;
private MenuItem mViewLinkMenuItem;
private String mLinkUrl;
Expand Down Expand Up @@ -367,13 +367,7 @@ public void onPause() {
}

mHighlighter.stop();

// Delete the note if user never edited a new note
if (newNoteWasNeverEdited()) {
permanentlyDeleteNote();
} else {
saveNote();
}
saveNote();

super.onPause();
}
Expand Down Expand Up @@ -502,10 +496,6 @@ private void showInfo() {
}
}

private boolean newNoteWasNeverEdited() {
return mNote != null && TextUtils.isEmpty(getNoteContentString()) && mNote.isNew() && !mTextDidChange;
}

protected void setMarkdownEnabled(boolean enabled) {
mIsMarkdownEnabled = enabled;

Expand All @@ -532,13 +522,7 @@ public void setNote(String noteID, String matchOffsets) {
}


if (newNoteWasNeverEdited()) {
// Delete a new, never edited note
permanentlyDeleteNote();
} else {
// If we have a note already (on a tablet in landscape), save the note.
saveNote();
}
saveNote();

new loadNoteTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, noteID);
}
Expand Down Expand Up @@ -659,7 +643,6 @@ public void afterTextChanged(Editable editable) {

@Override
public void onTextChanged(CharSequence charSequence, int start, int before, int count) {
mTextDidChange = true;
// When text changes, start timer that will fire after AUTOSAVE_DELAY_MILLIS passes
if (mAutoSaveHandler != null) {
mAutoSaveHandler.removeCallbacks(mAutoSaveRunnable);
Expand Down Expand Up @@ -1162,8 +1145,17 @@ protected Void doInBackground(String... args) {
mIsMarkdownEnabled = mNote.isMarkdownEnabled();
}
} catch (BucketObjectMissingException e) {
// TODO: Handle a missing note
// See if the note is in the object store
Bucket.ObjectCursor<Note> notesCursor = notesBucket.allObjects();
while (notesCursor.moveToNext()) {
Note currentNote = notesCursor.getObject();
if (currentNote != null && currentNote.getSimperiumKey().equals(noteID)) {
mNote = currentNote;
return null;
}
}
}

return null;
}

Expand Down

0 comments on commit 5c64538

Please sign in to comment.