mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-08-16 09:08:49 +00:00
Fix: Parsing clipboard's content for repo URI (closes #244)
This commit is contained in:
@@ -151,7 +151,7 @@ class EditRepositorySheetX() : FullscreenBottomSheetDialogFragment(), RepoManage
|
||||
|
||||
override fun updateSheet() {
|
||||
val repository = viewModel.repo.value
|
||||
if (repository == null) {
|
||||
if (repository == null || repository.address == "") {
|
||||
val clipboardManager =
|
||||
requireContext().getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val text = clipboardManager.primaryClip
|
||||
|
@@ -63,7 +63,7 @@ class RepositoriesViewModelX(val repositoryDao: RepositoryDao) : ViewModel() {
|
||||
}
|
||||
|
||||
private suspend fun addNewRepository(): Long = withContext(Dispatchers.IO) {
|
||||
repositoryDao.insert(newRepository(address = "new repository"))
|
||||
repositoryDao.insert(newRepository(fallbackName = "new repository"))
|
||||
repositoryDao.latestAddedId()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user