Skip to content
This repository was archived by the owner on Jul 9, 2019. It is now read-only.

Commit

Permalink
force schedules
Browse files Browse the repository at this point in the history
  • Loading branch information
James Baxley committed Dec 5, 2016
1 parent 8e4f50e commit 902472b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion imports/pages/give/schedules/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export default class Layout extends Component {

let complete = false;
if (
new Date(schedule.next) < moment().add(1, "day") &&
moment(schedule.next).add(1, "day") < moment().add(1, "day") &&
schedule.schedule.value === "One-Time"
) {
complete = true;
Expand Down
13 changes: 8 additions & 5 deletions imports/pages/give/schedules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const SCHEDULED_TRANSACTIONS_QUERY = gql`
next
end
id
entityId
reminderDate
code
gateway
Expand All @@ -107,8 +108,9 @@ const SCHEDULED_TRANSACTIONS_QUERY = gql`
}
`;

const withScheduledTransactions = graphql(SCHEDULED_TRANSACTIONS_QUERY, { name: "schedules" }, {
options: { ssr: false },
const withScheduledTransactions = graphql(SCHEDULED_TRANSACTIONS_QUERY, {
options: { ssr: false, forceFetch: true },
name: "schedules",
});

const FINANCIAL_ACCOUNTS_QUERY = gql`
Expand All @@ -125,16 +127,17 @@ const FINANCIAL_ACCOUNTS_QUERY = gql`
}
`;

const withFinancialAccounts = graphql(FINANCIAL_ACCOUNTS_QUERY, { name: "accounts" }, {
const withFinancialAccounts = graphql(FINANCIAL_ACCOUNTS_QUERY, {
options: { ssr: true },
name: "accounts",
});

const mapStateToProps = (store) => ({
give: store.give,
});

const Template = withScheduledTransactions(
withFinancialAccounts(
const Template = withFinancialAccounts(
withScheduledTransactions(
connect(mapStateToProps)(
TemplateWithoutData
)
Expand Down

0 comments on commit 902472b

Please sign in to comment.