mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-02-02 11:16:26 +00:00
finally works!
This commit is contained in:
parent
74f6f44a4b
commit
b9194a3284
1 changed files with 19 additions and 2 deletions
|
@ -335,6 +335,12 @@ abstract class SettingsStoreBase with Store {
|
||||||
_saveCurrentNode(change.newValue!, change.key!);
|
_saveCurrentNode(change.newValue!, change.key!);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.powNodes.observe((change) {
|
||||||
|
if (change.newValue != null && change.key != null) {
|
||||||
|
_saveCurrentPowNode(change.newValue!, change.key!);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static const defaultPinLength = 4;
|
static const defaultPinLength = 4;
|
||||||
|
@ -650,8 +656,6 @@ abstract class SettingsStoreBase with Store {
|
||||||
if (nanoPowNode != null) {
|
if (nanoPowNode != null) {
|
||||||
powNodes[WalletType.nano] = nanoPowNode;
|
powNodes[WalletType.nano] = nanoPowNode;
|
||||||
}
|
}
|
||||||
print(nanoPowNode);
|
|
||||||
print("@@@@@@@@@@@@");
|
|
||||||
|
|
||||||
final savedSyncMode = SyncMode.all.firstWhere((element) {
|
final savedSyncMode = SyncMode.all.firstWhere((element) {
|
||||||
return element.type.index == (sharedPreferences.getInt(PreferencesKey.syncModeKey) ?? 1);
|
return element.type.index == (sharedPreferences.getInt(PreferencesKey.syncModeKey) ?? 1);
|
||||||
|
@ -819,6 +823,7 @@ abstract class SettingsStoreBase with Store {
|
||||||
final havenNodeId = sharedPreferences.getInt(PreferencesKey.currentHavenNodeIdKey);
|
final havenNodeId = sharedPreferences.getInt(PreferencesKey.currentHavenNodeIdKey);
|
||||||
final ethereumNodeId = sharedPreferences.getInt(PreferencesKey.currentEthereumNodeIdKey);
|
final ethereumNodeId = sharedPreferences.getInt(PreferencesKey.currentEthereumNodeIdKey);
|
||||||
final nanoNodeId = sharedPreferences.getInt(PreferencesKey.currentNanoNodeIdKey);
|
final nanoNodeId = sharedPreferences.getInt(PreferencesKey.currentNanoNodeIdKey);
|
||||||
|
final nanoPowNodeId = sharedPreferences.getInt(PreferencesKey.currentNanoNodeIdKey);
|
||||||
final moneroNode = nodeSource.get(nodeId);
|
final moneroNode = nodeSource.get(nodeId);
|
||||||
final bitcoinElectrumServer = nodeSource.get(bitcoinElectrumServerId);
|
final bitcoinElectrumServer = nodeSource.get(bitcoinElectrumServerId);
|
||||||
final litecoinElectrumServer = nodeSource.get(litecoinElectrumServerId);
|
final litecoinElectrumServer = nodeSource.get(litecoinElectrumServerId);
|
||||||
|
@ -880,6 +885,18 @@ abstract class SettingsStoreBase with Store {
|
||||||
nodes[walletType] = node;
|
nodes[walletType] = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _saveCurrentPowNode(PowNode node, WalletType walletType) async {
|
||||||
|
switch (walletType) {
|
||||||
|
case WalletType.nano:
|
||||||
|
await _sharedPreferences.setInt(PreferencesKey.currentNanoPowNodeIdKey, node.key as int);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
powNodes[walletType] = node;
|
||||||
|
}
|
||||||
|
|
||||||
static Future<String?> _getDeviceName() async {
|
static Future<String?> _getDeviceName() async {
|
||||||
String? deviceName = '';
|
String? deviceName = '';
|
||||||
final deviceInfoPlugin = DeviceInfoPlugin();
|
final deviceInfoPlugin = DeviceInfoPlugin();
|
||||||
|
|
Loading…
Reference in a new issue