add clamp for path length

This commit is contained in:
PacoX
2026-05-27 08:32:16 +02:00
parent 5d03f99040
commit 6e81fdfd46
3 changed files with 125 additions and 4 deletions
+1 -1
View File
@@ -348,7 +348,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
}
String _pathHashModeSubtitle(int pathHashByteWidth) {
final width = pathHashByteWidth.clamp(1, 3).toInt();
final width = pathHashByteWidth.clamp(1, 4).toInt();
final mode = width - 1;
final unit = width == 1 ? 'byte' : 'bytes';
return 'Mode $mode - $width $unit per hop';