Skip to content

Commit

Permalink
Remove warnings about swaps-at-startup
Browse files Browse the repository at this point in the history
  • Loading branch information
dpad85 committed Aug 25, 2023
1 parent f655c58 commit cf3ed46
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ fun LiquidityPolicyView(
}
}

var showSuccessFeedback by remember { mutableStateOf(false) }
Card {
val keyboardManager = LocalSoftwareKeyboardController.current
val skipAbsoluteFeeCheck = if (liquidityPolicyPrefs is LiquidityPolicy.Auto) liquidityPolicyPrefs.skipAbsoluteFeeCheck else false
Expand All @@ -153,27 +152,14 @@ fun LiquidityPolicyView(
scope.launch {
if (newPolicy != null) {
UserPrefs.saveLiquidityPolicy(context, newPolicy)
if (newPolicy is LiquidityPolicy.Auto) showSuccessFeedback = true
peerManager.updatePeerLiquidityPolicy(newPolicy)
notificationsManager.dismissAllNotifications()
delay(5000)
showSuccessFeedback = false
}
}
},
)
}

if (showSuccessFeedback) {
Text(
text = stringResource(id = R.string.liquiditypolicy_save_done),
style = MaterialTheme.typography.body1.copy(fontSize = 14.sp, textAlign = TextAlign.Center),
modifier = Modifier
.fillMaxWidth()
.padding(16.dp)
)
}

} else {
Card(modifier = Modifier.fillMaxWidth()) {
ProgressView(text = stringResource(id = R.string.liquiditypolicy_loading))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ fun SwapInWalletInfo(
}
is LiquidityPolicy.Auto -> {
Text(text = annotatedStringResource(id = R.string.walletinfo_onchain_swapin_policy_auto_details, policy.maxAbsoluteFee.toPrettyString(btcUnit, withUnit = true)))
Spacer(modifier = Modifier.height(8.dp))
Text(text = stringResource(id = R.string.walletinfo_onchain_swapin_policy_auto_startup))
}
null -> {}
}
Expand Down
2 changes: 0 additions & 2 deletions phoenix-android/src/main/res/values-fr/important_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@
<string name="walletinfo_onchain_swapin_help">Les fonds envoyés vers ce wallet sont automatiquement basculés (\"swap\") sur Lightning.</string>
<string name="walletinfo_onchain_swapin_policy_view">Cliquez pour configurer.</string>
<string name="walletinfo_onchain_swapin_policy_auto_details">Les fonds seront automatiquement basculés sur Lightning si les frais sont <b>inférieurs à %1$s</b>.</string>
<string name="walletinfo_onchain_swapin_policy_auto_startup">Le swap sera tenté au prochain démarrage de l\'application.</string>
<string name="walletinfo_onchain_swapin_policy_disabled_details">La gestion des channels automatisée <b>est désactivée</b>. Les fonds ne seront pas basculés sur Lightning et vont rester sur ce wallet.</string>
<string name="walletinfo_onchain_swapin_empty">Il n\'y a pas de fonds en attente de swap.</string>

Expand Down Expand Up @@ -230,7 +229,6 @@
<string name="liquiditypolicy_advanced_pay_to_open_label">Déroger au max pour les paiements Lightning</string>
<string name="liquiditypolicy_advanced_pay_to_open_help">Si cette option est active, les paiements entrants Lightning seront acceptés même si les frais excèdent le maximum autorisé. Seule la valeur en pourcent ci-dessus sera vérifiée.\n\nAttention: si le mempool Bitcoin est plein, certains paiements Lightning entrants pourraient s\'avérer coûteux.</string>
<string name="liquiditypolicy_save_button">Enregistrer mes préferences</string>
<string name="liquiditypolicy_save_done">Préférences enregistrée.\nLes swaps seront tentés de nouveau au prochain démarrage de l\'application.</string>

<string name="liquiditypolicy_help">
Phoenix vous permet de recevoir des paiements sur la blockchain Bitcoin elle-même (L1), ainsi que sur la couche Lightning de Bitcoin (L2).
Expand Down
2 changes: 0 additions & 2 deletions phoenix-android/src/main/res/values/important_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@
<string name="walletinfo_onchain_swapin_help">Funds sent to this on-chain wallet are automatically swapped to Lightning.</string>
<string name="walletinfo_onchain_swapin_policy_view">Tap to configure.</string>
<string name="walletinfo_onchain_swapin_policy_auto_details">On-chain funds will automatically be swapped to Lightning if the fee is <b>less than %1$s</b>.</string>
<string name="walletinfo_onchain_swapin_policy_auto_startup">Swaps are attempted at application startup.</string>
<string name="walletinfo_onchain_swapin_policy_disabled_details">Automated fee policy <b>is disabled</b>. Funds will not be swapped. They will remain on this wallet.</string>
<string name="walletinfo_onchain_swapin_empty">There are no swaps in progress.</string>

Expand Down Expand Up @@ -230,7 +229,6 @@
<string name="liquiditypolicy_advanced_pay_to_open_label">Skip absolute fee check for Lightning</string>
<string name="liquiditypolicy_advanced_pay_to_open_help">When enabled, incoming Lightning payments will ignore the absolute max fee limit. Only the percentage check will apply.\n\nAttention: if the Bitcoin mempool feerate is high, incoming LN payments requiring an on-chain operation could be expensive.</string>
<string name="liquiditypolicy_save_button">Save policy</string>
<string name="liquiditypolicy_save_done">Policy saved.\nSwaps will be attempted at the next restart.</string>

<string name="liquiditypolicy_help">
Phoenix allows you to receive payments on Bitcoin\'s blockchain (L1) and Bitcoin\'s Lightning layer (L2).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,7 @@ struct SwapInWalletDetails: View {

} // </VStack>
.padding(.bottom, 5)

HStack(alignment: VerticalAlignment.firstTextBaseline, spacing: 5) {
Image(systemName: "pipe.and.drop")
.frame(minWidth: iconWidth, alignment: Alignment.leadingFirstTextBaseline)
.read(iconWidthReader)
Text("Swaps are only attempted at application startup.")
}
.font(.subheadline)
.foregroundColor(Color(UIColor.systemOrange))
.padding(.top, 5)


} // </Section>
.assignMaxPreference(for: iconWidthReader.key, to: $iconWidth)
}
Expand Down

0 comments on commit cf3ed46

Please sign in to comment.