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

Imroved Settings page, Updated content.js coupons auto-apply. #106

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

Abstra208
Copy link
Collaborator

No description provided.

Copy link

vercel bot commented Jan 14, 2025

Deployment failed with the following error:

Preview deployments are disabled for this project.

Copy link
Collaborator

@ImGajeed76 ImGajeed76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have a look at the rest later.

Comment on lines -3 to +23
fetch(
"https://api.discountdb.ch/api/v1/syrup/coupons?domain=" +
request.domain
)
let database = "";
try {
if (localStorage.getItem("database") === null) {
database = "https://api.discountdb.ch/api/v1/syrup/coupons";
} else {
database = localStorage.getItem("database");
}
} catch (e) {
database = "https://api.discountdb.ch/api/v1/syrup/coupons";
}
fetch(database + "?domain=" + request.domain)
.then((response) => response.json())
.then((data) => {
sendResponse({ coupons: data });
chrome.storage.local.set({ coupons: data }, () => {
if (chrome.runtime.lastError) {
console.error("Error setting coupons:", chrome.runtime.lastError);
sendResponse({ coupons: [] });
} else {
sendResponse({ coupons: data });
}
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the types/classes/functions from the sas client. I know you said thats not possible but as of a quick search it should be. Though i didnt try yet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot import anything in content.js

Copy link

@black-backdoor black-backdoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing the popup for coupons, it currently displays:
screenshot

Extension-React/public/content.js Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@Abstra208 Abstra208 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing the popup for coupons, it currently displays:
screenshot

Are you using firefox?
What is your browser's languages set to?

@Abstra208 Abstra208 requested a review from ImGajeed76 January 15, 2025 18:00
@black-backdoor
Copy link

black-backdoor commented Jan 15, 2025

Are you using firefox? What is your browser's languages set to?

I tried manually setting the language to several different options.

Previously, I didn't have much time, so I couldn't run detailed tests, but I encountered a error
[Syrup] Failed to load translations: TypeError: Failed to fetch

I also tried the same approach with the code from the main branch, but I encountered the same error.

EDIT: it's trying to load /_locales/en-GB/messages.json #107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants