How to check if the user is viewing the primary market

Is it possible to check if the user is viewing the primary Market using either liquid or js?

shop_locale has a primary attribute for the locale - Liquid objects

There is no equivalent for checking the primary market.

I don’t think a field like that exists for market but you could add a primary boolean metafield definition to market and check it like this:
{{ localization.market.metafields.custom.primary }}

Thanks for that @daniel - this was my backup, but it seems like some oversight to not expose the primary attribute in liquid if the workaround is to:

  1. make a call to get the primary
  2. make a call to set a metafield on it
  3. listen to webhooks for markets/update to see if the primary gets changed
  4. update it again whenever it changes.

Just bumping this thread up to see if any Shopifolk are back online now in the new year.

How can we get a feature request in to add the primary attribute to the Markets liquid object?