Enable transactions
This commit is contained in:
parent
aeb80442a6
commit
f6ef23eabb
|
|
@ -2,7 +2,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/transaction/transaction_actions.dart';
|
import 'package:invoiceninja_flutter/redux/transaction/transaction_actions.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
|
||||||
|
|
||||||
// Package imports:
|
// Package imports:
|
||||||
import 'package:redux/redux.dart';
|
import 'package:redux/redux.dart';
|
||||||
|
|
@ -253,11 +252,8 @@ Middleware<AppState> _loadRecurringExpenses(
|
||||||
if (action.completer != null) {
|
if (action.completer != null) {
|
||||||
action.completer.complete(null);
|
action.completer.complete(null);
|
||||||
}
|
}
|
||||||
if (supportsBankAccounts()) {
|
|
||||||
store.dispatch(LoadTransactions());
|
store.dispatch(LoadTransactions());
|
||||||
} else {
|
|
||||||
store.dispatch(PersistData());
|
|
||||||
}
|
|
||||||
}).catchError((Object error) {
|
}).catchError((Object error) {
|
||||||
print(error);
|
print(error);
|
||||||
store.dispatch(LoadRecurringExpensesFailure(error));
|
store.dispatch(LoadRecurringExpensesFailure(error));
|
||||||
|
|
|
||||||
|
|
@ -654,13 +654,12 @@ class _MenuDrawerState extends State<MenuDrawer> {
|
||||||
icon: getEntityIcon(EntityType.recurringExpense),
|
icon: getEntityIcon(EntityType.recurringExpense),
|
||||||
title: localization.recurringExpenses,
|
title: localization.recurringExpenses,
|
||||||
),
|
),
|
||||||
if (supportsBankAccounts())
|
DrawerTile(
|
||||||
DrawerTile(
|
company: company,
|
||||||
company: company,
|
entityType: EntityType.transaction,
|
||||||
entityType: EntityType.transaction,
|
icon: getEntityIcon(EntityType.transaction),
|
||||||
icon: getEntityIcon(EntityType.transaction),
|
title: localization.transactions,
|
||||||
title: localization.transactions,
|
),
|
||||||
),
|
|
||||||
if (!isApple() || state.isProPlan)
|
if (!isApple() || state.isProPlan)
|
||||||
DrawerTile(
|
DrawerTile(
|
||||||
company: company,
|
company: company,
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ class _SettingsListState extends State<SettingsList> {
|
||||||
section: kSettingsTemplatesAndReminders,
|
section: kSettingsTemplatesAndReminders,
|
||||||
viewModel: widget.viewModel,
|
viewModel: widget.viewModel,
|
||||||
),
|
),
|
||||||
if (showAll && supportsBankAccounts())
|
if (showAll)
|
||||||
SettingsListTile(
|
SettingsListTile(
|
||||||
section: kSettingsBankAccounts,
|
section: kSettingsBankAccounts,
|
||||||
viewModel: widget.viewModel,
|
viewModel: widget.viewModel,
|
||||||
|
|
@ -574,12 +574,11 @@ class SettingsSearch extends StatelessWidget {
|
||||||
'late_fees',
|
'late_fees',
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
if (supportsBankAccounts())
|
kSettingsBankAccounts: [
|
||||||
kSettingsBankAccounts: [
|
[
|
||||||
[
|
'bank_accounts',
|
||||||
'bank_accounts',
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
|
],
|
||||||
kSettingsGroupSettings: [
|
kSettingsGroupSettings: [
|
||||||
[
|
[
|
||||||
'groups',
|
'groups',
|
||||||
|
|
|
||||||
|
|
@ -31,20 +31,6 @@ bool supportsAppleOAuth() => kIsWeb || isApple();
|
||||||
// TODO remove this function
|
// TODO remove this function
|
||||||
bool supportsMicrosoftOAuth() => kIsWeb;
|
bool supportsMicrosoftOAuth() => kIsWeb;
|
||||||
|
|
||||||
// TODO remove this function
|
|
||||||
bool supportsBankAccounts() {
|
|
||||||
if (!kReleaseMode) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
|
|
||||||
if (store.state.isSelfHosted) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool supportsInAppPurchase() {
|
bool supportsInAppPurchase() {
|
||||||
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
|
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
|
||||||
if (store.state.isSelfHosted) {
|
if (store.state.isSelfHosted) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue