Skip to content

Commit d29612f

Browse files
committed
fix(Advocate): sets rewardedOn in dApp for quick feedback
1 parent ec87f29 commit d29612f

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/sagas/Advocate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function* withdraw(action) {
147147
prey.onFound = () => {
148148
global.store.dispatch({
149149
type: ADVOCATE_REWARD,
150-
payload: action.payload
150+
payload: { ...action.payload, rewardedOn: new Date().getTime() / 1000 }
151151
});
152152

153153
global.store.dispatch({ type: LOOKUP_WALLET_BALANCE });

src/utils/AdvocateHelpers.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,17 @@ export function makeKey({ activityScId, slotScId }) {
7272
return keyScId(activityScId, slotScId);
7373
}
7474

75-
export function setSlotState(state, { activityScId, slotScId }, slots) {
75+
export function setSlotState(state, slot, slots) {
76+
const { activityScId, slotScId } = slot;
7677
return slots.map(a => {
7778
if (
7879
a.attributes.activityScId === activityScId &&
7980
a.attributes.slotScId === slotScId
8081
) {
81-
return { ...a, attributes: { ...a.attributes, state } };
82+
return {
83+
...a,
84+
attributes: { ...a.attributes, ...slot, state }
85+
};
8286
}
8387
return a;
8488
});

0 commit comments

Comments
 (0)