Skip to content
Merged
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
2 changes: 1 addition & 1 deletion checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
function releaseWakeLock() {
isCheckoutProcessing = false;
if (checkoutWakeLock !== null) {
checkoutWakeLock.release()

Check failure on line 23 in checkout.js

View workflow job for this annotation

GitHub Actions / JavaScript Linting (ESLint)

Insert `⏎······`
.catch(err => console.error(err))

Check failure on line 24 in checkout.js

View workflow job for this annotation

GitHub Actions / JavaScript Linting (ESLint)

Replace `err` with `(err)`
.finally(() => {
checkoutWakeLock = null;
});
Expand Down Expand Up @@ -50,7 +50,7 @@
}
}

const API_BASE_URL = window.CARA_API_BASE_URL || '';

Check failure on line 53 in checkout.js

View workflow job for this annotation

GitHub Actions / JavaScript Linting (ESLint)

Delete `⏎`


function buildAuthHeaders(extraHeaders = {}) {
Expand All @@ -76,7 +76,7 @@

return cart.map((item) => {
const candidate = Number(item.id);
if (item.id != null && item.id !== '' && !Number.isNaN(candidate) && byId.has(candidate)) {

Check failure on line 79 in checkout.js

View workflow job for this annotation

GitHub Actions / JavaScript Linting (ESLint)

Replace `item.id·!=·null·&&·item.id·!==·''·&&·!Number.isNaN(candidate)·&&·byId.has(candidate)` with `⏎······item.id·!=·null·&&⏎······item.id·!==·''·&&⏎······!Number.isNaN(candidate)·&&⏎······byId.has(candidate)⏎····`
return { ...item, id: candidate };
}
const resolved = byName.get(item.name);
Expand Down Expand Up @@ -437,8 +437,8 @@
res
.json()
.then((data) => ({ status: res.status, ok: res.ok, body: data }))
.catch(err => {

Check failure on line 440 in checkout.js

View workflow job for this annotation

GitHub Actions / JavaScript Linting (ESLint)

Replace `err` with `(err)`
console.warn("[Checkout] Operation failed:", err);

Check failure on line 441 in checkout.js

View workflow job for this annotation

GitHub Actions / JavaScript Linting (ESLint)

Replace `"[Checkout]·Operation·failed:"` with `'[Checkout]·Operation·failed:'`
throw err;
}),
)
Expand All @@ -457,7 +457,7 @@
sum + parsePriceString(item.price) * (parseInt(item.quantity, 10) || 1),
0,
);
const earnedPoints = Math.floor(subtotal * (window.CARA_CONFIG ? window.CARA_CONFIG.LOYALTY.POINTS_PER_RUPEE / 100 : 0.1));
const earnedPoints = Math.floor(subtotal * (window.CARA_CONFIG ? window.CARA_CONFIG.LOYALTY.POINTS_PER_RUPEE : 10));
const newBalance = Math.max(
0,
currentBalance - appliedPoints + earnedPoints,
Expand Down
Loading