diff --git a/lib/hive/db.dart b/lib/hive/db.dart index 062d029a5..531771f09 100644 --- a/lib/hive/db.dart +++ b/lib/hive/db.dart @@ -9,6 +9,7 @@ import 'package:stackwallet/models/node_model.dart'; import 'package:stackwallet/models/notification_model.dart'; import 'package:stackwallet/models/trade_wallet_lookup.dart'; import 'package:stackwallet/services/wallets_service.dart'; +import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; @@ -142,6 +143,13 @@ class DB { _loadSharedCoinCacheBoxes(), ]); _initialized = true; + + if (get(boxName: boxNamePrefs, key: "familiarity") == null) { + await put(boxName: boxNamePrefs, key: "familiarity", value: 0); + } + int count = get(boxName: boxNamePrefs, key: "familiarity") as int; + await put(boxName: boxNamePrefs, key: "familiarity", value: count + 1); + Constants.exchangeForExperiencedUsers(count + 1); } } diff --git a/lib/utilities/constants.dart b/lib/utilities/constants.dart index 2495a6be4..c4ac4bbe9 100644 --- a/lib/utilities/constants.dart +++ b/lib/utilities/constants.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/util.dart'; class _LayoutSizing { const _LayoutSizing(); @@ -14,7 +15,12 @@ class _LayoutSizing { abstract class Constants { static const size = _LayoutSizing(); - static final bool enableExchange = !Platform.isIOS; + static void exchangeForExperiencedUsers(int count) { + enableExchange = + Util.isDesktop || Platform.isAndroid || count > 5 || !Platform.isIOS; + } + + static bool enableExchange = Util.isDesktop || !Platform.isIOS; //TODO: correct for monero? static const int satsPerCoinMonero = 1000000000000;