mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-05-10 05:22:13 +00:00
fix tor background sync (will work on test builds after #2142 is merged and this PR is rebased on top)
This commit is contained in:
parent
7636aaedc2
commit
40a1cf9f7b
2 changed files with 7 additions and 2 deletions
2
.github/workflows/no_http_imports.yaml
vendored
2
.github/workflows/no_http_imports.yaml
vendored
|
@ -11,7 +11,7 @@ jobs:
|
|||
- name: Check for http package usage
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
GIT_GREP_OUT="$(git grep package:http | (grep .dart: || test $? = 1) || true)"
|
||||
GIT_GREP_OUT="$(git grep package:http | (grep .dart: || test $? = 1) | (grep -v proxy_wrapper.dart || test $? = 1) || true)"
|
||||
[[ "x$GIT_GREP_OUT" == "x" ]] && exit 0
|
||||
echo "$GIT_GREP_OUT"
|
||||
echo "There are .dart files which use http imports"
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:cake_wallet/di.dart';
|
|||
import 'package:cake_wallet/entities/preferences_key.dart';
|
||||
import 'package:cake_wallet/store/settings_store.dart';
|
||||
import 'package:cake_wallet/utils/feature_flag.dart';
|
||||
import 'package:cake_wallet/utils/tor.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
|
||||
import 'package:cw_core/sync_status.dart';
|
||||
|
@ -91,6 +92,11 @@ class BackgroundSync {
|
|||
}
|
||||
|
||||
Future<void> sync() async {
|
||||
final settingsStore = getIt.get<SettingsStore>();
|
||||
if (settingsStore.currentBuiltinTor) {
|
||||
printV("Starting Tor");
|
||||
await ensureTorStarted(context: null);
|
||||
}
|
||||
printV("Background sync started");
|
||||
await _syncWallets();
|
||||
printV("Background sync completed");
|
||||
|
@ -101,7 +107,6 @@ class BackgroundSync {
|
|||
final walletListViewModel = getIt.get<WalletListViewModel>();
|
||||
final settingsStore = getIt.get<SettingsStore>();
|
||||
|
||||
|
||||
final List<WalletListItem> moneroWallets = walletListViewModel.wallets
|
||||
.where((element) => !element.isHardware)
|
||||
.where((element) => ![WalletType.haven, WalletType.decred].contains(element.type))
|
||||
|
|
Loading…
Reference in a new issue