Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use acct svc in cc cleared (fixes #2968) #2980

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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