@riosst100/pwa-marketplace 3.2.2 → 3.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riosst100/pwa-marketplace",
3
3
  "author": "riosst100@gmail.com",
4
- "version": "3.2.2",
4
+ "version": "3.2.4",
5
5
  "main": "src/index.js",
6
6
  "pwa-studio": {
7
7
  "targets": {
@@ -14,12 +14,21 @@ const WebsiteSwitcherItem = props => {
14
14
  const href = location.href;
15
15
 
16
16
  let match = location && location.pathname.split("/")[1];
17
-
17
+
18
18
  const websiteCode = option2 != "base" ? option2 : '';
19
- if (option2 == "base") {
19
+
20
+ let url = href + websiteCode;
21
+
22
+
23
+ if (match && option2 == "base") {
20
24
  match = match + "/";
25
+
26
+ url = href.replace(match, websiteCode);
21
27
  }
22
- const url = href.replace(match, websiteCode);
28
+
29
+ console.log('href',href)
30
+ console.log('match',match)
31
+ console.log('url',url)
23
32
 
24
33
  // const handleClick = useCallback(() => {
25
34
  // onClick(option, option2);
@@ -73,10 +73,10 @@ const Adapter = props => {
73
73
  const match = location && location.pathname.split("/")[1];
74
74
  let websiteCodeInUrl = websiteCodes.find((str) => str === match);
75
75
 
76
- const { getWebsiteByUserIp } = useWebsiteByIp(websiteCodeInUrl);
77
- // const getWebsiteByUserIp = {
78
- // countryCode: 'SG'
79
- // }
76
+ // const { getWebsiteByUserIp } = useWebsiteByIp(websiteCodeInUrl);
77
+ const getWebsiteByUserIp = {
78
+ countryCode: 'SG'
79
+ }
80
80
 
81
81
  useEffect(() => {
82
82
  if (websiteCodeInUrl) {
@@ -157,7 +157,8 @@ const Adapter = props => {
157
157
  storage.getItem('access_base_website') || null
158
158
  );
159
159
 
160
- const websiteCode = getWebsiteByUserIp.countryCode && !isAccessBaseWebsite ? getWebsiteByUserIp.countryCode.toLowerCase() : process.env.WEBSITE_CODE;
160
+ // const websiteCode = getWebsiteByUserIp.countryCode && !isAccessBaseWebsite ? getWebsiteByUserIp.countryCode.toLowerCase() : process.env.WEBSITE_CODE;
161
+ const websiteCode = process.env.WEBSITE_CODE;
161
162
 
162
163
  if (websiteCodes.find((str) => str === websiteCode)) {
163
164
  routerProps.basename = websiteCode != process.env.WEBSITE_CODE && !isAccessBaseWebsite ? '/'+websiteCode : '/';