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

Fixed notifications to respect add to cart config #3229

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/messaging/pushover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
const message: PushoverMessage =
pushover.priority < 2
? {
message: link.cartUrl ? link.cartUrl : link.url,
message:
link.cartUrl && config.store.autoAddToCart ? link.cartUrl : link.url,

Check failure on line 21 in src/messaging/pushover.ts

View workflow job for this annotation

GitHub Actions / Build and lint

Replace `·?·link.cartUrl` with `⏎················?·link.cartUrl⏎···············`
priority: pushover.priority,
sound: pushover.sound,
title: Print.inStock(link, store),
Expand All @@ -26,7 +27,8 @@
}
: {
expire: pushover.expire,
message: link.cartUrl ? link.cartUrl : link.url,
message:
link.cartUrl && config.store.autoAddToCart ? link.cartUrl : link.url,

Check failure on line 31 in src/messaging/pushover.ts

View workflow job for this annotation

GitHub Actions / Build and lint

Replace `··?·link.cartUrl` with `⏎················?·link.cartUrl⏎···············`
priority: pushover.priority,
sound: pushover.sound,
retry: pushover.retry,
Expand Down
3 changes: 2 additions & 1 deletion src/messaging/twilio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export function sendTwilioMessage(link: Link, store: Store) {
logger.debug('↗ sending twilio message');

(async () => {
const givenUrl = link.cartUrl ? link.cartUrl : link.url;
const givenUrl =
link.cartUrl && config.store.autoAddToCart ? link.cartUrl : link.url;
const message = `${Print.inStock(link, store)}\n${givenUrl}`;
const numbers = twilio.to.split(',');
const results = [];
Expand Down
Loading