only prompt on unsub

This commit is contained in:
ntr 2019-08-29 13:44:03 +10:00
parent fec338e256
commit 1531a8b2f8

View File

@ -28,8 +28,9 @@ function registerEvents(store) {
}
function setSubscription(sub) {
if (sub.cancel_at_period_end) {
notify('Your subscription has been cancelled. Thank you for your support.')
const { subscription } = store.getState();
if (subscription && sub.cancel_at_period_end) {
notify('Your subscription has been cancelled. Thank you for your support.');
}
store.dispatch(actions.setSubscription(sub));
}