add clamp for path length
This commit is contained in:
1 parent
5d03f99040
commit
6e81fdfd46
3 files changed
+125
-4
No files matched your search
@@ -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';
|
||||
|
||||
Reference in new issue
Block a user