Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardlyhel committed Jan 24, 2025
1 parent 89de145 commit 17c2775
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ const customerAccountUrl = `https://shopify.com/${shopId}`;

describe('return correct urls', () => {
describe('when shopId is provided', () => {
const getAccountUrl = createCustomerAccountHelper(
'2025-01',
shopId,
);
const getAccountUrl = createCustomerAccountHelper('2025-01', shopId);

it('returns customer account base url', () => {
expect(getAccountUrl(URL_TYPE.CA_BASE_URL)).toBe(customerAccountUrl);
Expand Down
4 changes: 2 additions & 2 deletions packages/hydrogen/src/customer/customer-account-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export function createCustomerAccountHelper(
customerApiVersion: string,
shopId: string,
) {
const customerAccountUrl = `https://shopify.com/${shopId}`
const customerAccountAuthUrl = `https://shopify.com/authentication/${shopId}`
const customerAccountUrl = `https://shopify.com/${shopId}`;
const customerAccountAuthUrl = `https://shopify.com/authentication/${shopId}`;

return function getCustomerAccountUrl(urlType: URL_TYPE): string {
switch (urlType) {
Expand Down
3 changes: 1 addition & 2 deletions packages/hydrogen/src/customer/customer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ export function createCustomerAccountClient({
}

async function isLoggedIn() {
if (!shopId)
return false;
if (!shopId) return false;

const customerAccount = session.get(CUSTOMER_ACCOUNT_SESSION_KEY);
const accessToken = customerAccount?.accessToken;
Expand Down

0 comments on commit 17c2775

Please sign in to comment.