Skip to content

Commit

Permalink
name arg and remove dangerous parse
Browse files Browse the repository at this point in the history
  • Loading branch information
dseverns-livefront committed Oct 25, 2024
1 parent 7f70e49 commit 85e9ade
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.x8bit.bitwarden.ui.vault.feature.importlogins

import android.net.Uri
import androidx.lifecycle.viewModelScope
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.data.platform.repository.EnvironmentRepository
import com.x8bit.bitwarden.data.platform.util.toUriOrNull
import com.x8bit.bitwarden.data.vault.repository.VaultRepository
import com.x8bit.bitwarden.data.vault.repository.model.SyncVaultDataResult
import com.x8bit.bitwarden.ui.platform.base.BaseViewModel
Expand All @@ -28,12 +28,12 @@ class ImportLoginsViewModel @Inject constructor(
val vaultUrl = environmentRepository.environment.environmentUrlData.webVault
?: environmentRepository.environment.environmentUrlData.base
ImportLoginsState(
null,
dialogState = null,
viewState = ImportLoginsState.ViewState.InitialContent,
isVaultSyncing = false,
showBottomSheet = false,
// attempt to trim the scheme of the vault url
currentWebVaultUrl = Uri.parse(vaultUrl).host ?: vaultUrl,
currentWebVaultUrl = vaultUrl.toUriOrNull()?.host ?: vaultUrl,
)
},
) {
Expand Down

0 comments on commit 85e9ade

Please sign in to comment.