Skip to content

Commit

Permalink
Issue #65: Handle url encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrDeveloper committed Sep 16, 2024
1 parent 704c478 commit 1cfaa18
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import com.amrdeveloper.linkhub.util.UiPreferences
import com.amrdeveloper.linkhub.util.showError
import com.amrdeveloper.linkhub.util.showSnackBar
import dagger.hilt.android.AndroidEntryPoint
import java.net.URLEncoder
import java.text.DateFormat
import javax.inject.Inject

Expand Down Expand Up @@ -90,7 +91,9 @@ class LinkFragment : Fragment() {
}

binding.linkUrlEdit.setText(sharedLink)
linkViewModel.generateLinkTitleAndSubTitle(sharedLink)

val encodedUrl = URLEncoder.encode(sharedLink, "utf-8")
linkViewModel.generateLinkTitleAndSubTitle(encodedUrl)
}

private fun handleLinkArgument() {
Expand Down

0 comments on commit 1cfaa18

Please sign in to comment.