mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-16 17:27:39 +00:00
enable solana and disable frost on desktop in release builds
This commit is contained in:
parent
cf565944e2
commit
fa8829072e
3 changed files with 4 additions and 56 deletions
|
@ -11,6 +11,7 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
@ -134,9 +135,9 @@ class _AddWalletViewState extends ConsumerState<AddWalletView> {
|
|||
_coins.remove(Coin.wownero);
|
||||
}
|
||||
|
||||
// Remove Solana from the list of coins based on our frostEnabled preference.
|
||||
if (!ref.read(prefsChangeNotifierProvider).solanaEnabled) {
|
||||
_coins.remove(Coin.solana);
|
||||
if (Util.isDesktop && !kDebugMode) {
|
||||
_coins.remove(Coin.bitcoinFrost);
|
||||
_coins.remove(Coin.bitcoinFrostTestNet);
|
||||
}
|
||||
|
||||
coinEntities.addAll(_coins.map((e) => CoinEntity(e)));
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
@ -277,36 +276,6 @@ class HiddenSettings extends StatelessWidget {
|
|||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Consumer(
|
||||
builder: (_, ref, __) {
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
ref
|
||||
.read(prefsChangeNotifierProvider)
|
||||
.solanaEnabled =
|
||||
!(ref
|
||||
.read(prefsChangeNotifierProvider)
|
||||
.solanaEnabled);
|
||||
if (kDebugMode) {
|
||||
print(
|
||||
"Solana enabled: ${ref.read(prefsChangeNotifierProvider).solanaEnabled}");
|
||||
}
|
||||
},
|
||||
child: RoundedWhiteContainer(
|
||||
child: Text(
|
||||
"Toggle Solana",
|
||||
style: STextStyles.button(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.accentColorDark),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Consumer(
|
||||
builder: (_, ref, __) {
|
||||
return GestureDetector(
|
||||
|
|
|
@ -68,7 +68,6 @@ class Prefs extends ChangeNotifier {
|
|||
await _setMaxDecimals();
|
||||
_useTor = await _getUseTor();
|
||||
_fusionServerInfo = await _getFusionServerInfo();
|
||||
_solanaEnabled = await _getSolanaEnabled();
|
||||
|
||||
_initialized = true;
|
||||
}
|
||||
|
@ -1009,25 +1008,4 @@ class Prefs extends ChangeNotifier {
|
|||
|
||||
return actualMap;
|
||||
}
|
||||
|
||||
// Solana
|
||||
|
||||
bool _solanaEnabled = false;
|
||||
|
||||
bool get solanaEnabled => _solanaEnabled;
|
||||
|
||||
set solanaEnabled(bool solanaEnabled) {
|
||||
if (_solanaEnabled != solanaEnabled) {
|
||||
DB.instance.put<dynamic>(
|
||||
boxName: DB.boxNamePrefs, key: "solanaEnabled", value: solanaEnabled);
|
||||
_solanaEnabled = solanaEnabled;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> _getSolanaEnabled() async {
|
||||
return await DB.instance.get<dynamic>(
|
||||
boxName: DB.boxNamePrefs, key: "solanaEnabled") as bool? ??
|
||||
false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue