Skip to content

Commit

Permalink
fix: use acct svc in cc cleared (fixes #2968) (#2980)
Browse files Browse the repository at this point in the history
  • Loading branch information
williammck committed Nov 20, 2022
1 parent b30c607 commit a96cc5e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Feature } from 'toolkit/extension/features/feature';
import { isCurrentRouteAccountsPage } from 'toolkit/extension/utils/ynab';
import { controllerLookup } from 'toolkit/extension/utils/ember';
import { serviceLookup } from 'toolkit/extension/utils/ember';
import { formatCurrency, stripCurrency } from 'toolkit/extension/utils/currency';

export class DefaultCCToCleared extends Feature {
didClickRecord = false;

shouldInvoke() {
// grab the current account
let { selectedAccount } = controllerLookup('accounts');
let { selectedAccount } = serviceLookup('accounts');
return (
// only activate if we're on an accounts page and it's a credit card account
isCurrentRouteAccountsPage() &&
Expand Down Expand Up @@ -58,7 +58,7 @@ export class DefaultCCToCleared extends Feature {
// transaction entry model to appear
if (didChangeInput && this.didClickRecord) {
// grab amounts from account
let { selectedAccount } = controllerLookup('accounts');
let { selectedAccount } = serviceLookup('accounts');
const clearedBal = selectedAccount.accountCalculation.clearedBalance;

// we want to fill in the absolute value of cleared bal, since it's positive infow,
Expand Down

0 comments on commit a96cc5e

Please sign in to comment.