Skip to content

Commit

Permalink
Merge pull request #507 from FineFindus/fix/note-save-crash
Browse files Browse the repository at this point in the history
fix(Profile) note save crash
  • Loading branch information
LucasGGamerM authored Aug 14, 2024
2 parents 806db1d + 420233d commit 4aecb17
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import androidx.viewpager2.widget.ViewPager2;

import org.joinmastodon.android.GlobalUserPreferences;
import org.joinmastodon.android.MastodonApp;
import org.joinmastodon.android.R;
import org.joinmastodon.android.api.requests.accounts.GetAccountByID;
import org.joinmastodon.android.api.requests.accounts.GetAccountRelationships;
Expand Down Expand Up @@ -453,8 +454,8 @@ private void showPrivateNote(){
}

private void hidePrivateNote(){
noteWrap.setVisibility(View.GONE);
noteEdit.setText(null);
noteWrap.setVisibility(View.GONE);
}

private void savePrivateNote(String note){
Expand All @@ -468,7 +469,8 @@ private void savePrivateNote(String note){
public void onSuccess(Relationship result) {
updateRelationship(result);
invalidateOptionsMenu();
Toast.makeText(getContext(), R.string.mo_personal_note_saved, Toast.LENGTH_SHORT).show();
if(!TextUtils.isEmpty(result.note))
Toast.makeText(MastodonApp.context, R.string.mo_personal_note_saved, Toast.LENGTH_SHORT).show();
}

@Override
Expand Down

0 comments on commit 4aecb17

Please sign in to comment.