Skip to content

Commit

Permalink
fix: blank text check
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelonion committed May 12, 2024
1 parent fa659c7 commit 6e3a3bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class MarkdownCreatorActivity : AppCompatActivity() {
}

binding.createButton.setOnClickListener {
if (text.isBlank()) {
toast(getString(R.string.cannot_be_empty))
return@setOnClickListener
}
launchIO {
val success = when (type) {
"activity" -> Anilist.mutation.postActivity(text)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -984,4 +984,5 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
<string name="create_new_review">Create New Review</string>
<string name="create">Create</string>
<string name="preview">Preview</string>
<string name="cannot_be_empty">Text cannot be empty</string>
</resources>

0 comments on commit 6e3a3bb

Please sign in to comment.