mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-09 10:16:04 +00:00
fixes
This commit is contained in:
parent
ac67d50a47
commit
33cb419fcc
2 changed files with 13 additions and 1 deletions
lib
|
@ -160,6 +160,7 @@ Future defaultSettingsMigration(
|
||||||
case 22:
|
case 22:
|
||||||
await addNanoNodeList(nodes: nodes);
|
await addNanoNodeList(nodes: nodes);
|
||||||
await changeNanoCurrentNodeToDefault(sharedPreferences: sharedPreferences, nodes: nodes);
|
await changeNanoCurrentNodeToDefault(sharedPreferences: sharedPreferences, nodes: nodes);
|
||||||
|
await changeNanoCurrentPowNodeToDefault(sharedPreferences: sharedPreferences, nodes: nodes);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -574,3 +575,10 @@ Future<void> changeNanoCurrentNodeToDefault(
|
||||||
|
|
||||||
await sharedPreferences.setInt(PreferencesKey.currentNanoNodeIdKey, nodeId);
|
await sharedPreferences.setInt(PreferencesKey.currentNanoNodeIdKey, nodeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> changeNanoCurrentPowNodeToDefault(
|
||||||
|
{required SharedPreferences sharedPreferences, required Box<Node> nodes}) async {
|
||||||
|
final node = getNanoDefaultPowNode(nodes: nodes);
|
||||||
|
final nodeId = node?.key as int? ?? 0;
|
||||||
|
await sharedPreferences.setInt(PreferencesKey.currentNanoPowNodeIdKey, nodeId);
|
||||||
|
}
|
||||||
|
|
|
@ -45,7 +45,11 @@ class ManagePowNodesPage extends BasePage {
|
||||||
},
|
},
|
||||||
itemBuilder: (_, sectionIndex, index) {
|
itemBuilder: (_, sectionIndex, index) {
|
||||||
final node = nodeListViewModel.nodes[index];
|
final node = nodeListViewModel.nodes[index];
|
||||||
final isSelected = node.keyIndex == nodeListViewModel.currentNode.keyIndex;
|
// technically not correct but the node doesn't
|
||||||
|
// have any potentially unique attributes (keyIndex -> hashCode)
|
||||||
|
// and it fixes the bug where the default (pow) node is not highlighted until
|
||||||
|
// after making a selection
|
||||||
|
final isSelected = node.hashCode == nodeListViewModel.currentNode.hashCode;
|
||||||
final nodeListRow = NodeListRow(
|
final nodeListRow = NodeListRow(
|
||||||
title: node.uriRaw,
|
title: node.uriRaw,
|
||||||
node: node,
|
node: node,
|
||||||
|
|
Loading…
Reference in a new issue