Skip to content

Commit 5e0ea9a

Browse files
vascYTnorhu1130
andauthored
fix: bump storefront v2 -> v3 (#22)
Co-authored-by: norhu1130 <norhu1130@naver.com>
1 parent 0a0fc71 commit 5e0ea9a

File tree

8 files changed

+26
-27
lines changed

8 files changed

+26
-27
lines changed

android/app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ android {
118118
applicationId "dev.vasc.vshop2"
119119
minSdkVersion rootProject.ext.minSdkVersion
120120
targetSdkVersion rootProject.ext.targetSdkVersion
121-
versionCode 54
121+
versionCode 55
122122
versionName npmVersion
123123
}
124124

ios/vshop_mobile.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@
533533
CODE_SIGN_ENTITLEMENTS = vshop_mobile/vshop_mobile.entitlements;
534534
CODE_SIGN_IDENTITY = "Apple Development";
535535
CODE_SIGN_STYLE = Automatic;
536-
CURRENT_PROJECT_VERSION = 19;
536+
CURRENT_PROJECT_VERSION = 20;
537537
DEVELOPMENT_TEAM = H4F94U74J4;
538538
ENABLE_BITCODE = NO;
539539
INFOPLIST_FILE = vshop_mobile/Info.plist;
@@ -542,7 +542,7 @@
542542
"$(inherited)",
543543
"@executable_path/Frameworks",
544544
);
545-
MARKETING_VERSION = 2.7.4;
545+
MARKETING_VERSION = 2.7.5;
546546
OTHER_LDFLAGS = (
547547
"$(inherited)",
548548
"-ObjC",
@@ -566,15 +566,15 @@
566566
CODE_SIGN_ENTITLEMENTS = vshop_mobile/vshop_mobile.entitlements;
567567
CODE_SIGN_IDENTITY = "Apple Development";
568568
CODE_SIGN_STYLE = Automatic;
569-
CURRENT_PROJECT_VERSION = 19;
569+
CURRENT_PROJECT_VERSION = 20;
570570
DEVELOPMENT_TEAM = H4F94U74J4;
571571
INFOPLIST_FILE = vshop_mobile/Info.plist;
572572
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
573573
LD_RUNPATH_SEARCH_PATHS = (
574574
"$(inherited)",
575575
"@executable_path/Frameworks",
576576
);
577-
MARKETING_VERSION = 2.7.4;
577+
MARKETING_VERSION = 2.7.5;
578578
OTHER_LDFLAGS = (
579579
"$(inherited)",
580580
"-ObjC",

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vshop_mobile",
3-
"version": "2.7.4",
3+
"version": "2.7.5",
44
"private": true,
55
"scripts": {
66
"android": "react-native run-android",
@@ -116,5 +116,6 @@
116116
"http": "@tradle/react-native-http",
117117
"https": "https-browserify",
118118
"stream": "stream-browserify"
119-
}
119+
},
120+
"packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
120121
}

src/screens/ReAuth.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default function ReAuthScreen() {
8282
region,
8383
userId,
8484
);
85-
const shops = await parseShop(shop.data);
85+
const shops = await parseShop(shop);
8686

8787
setLoading(t("fetching.progress"));
8888
const progress = await getProgress(

src/screens/Wizard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default function WizardScreen() {
8686
user.region,
8787
userId,
8888
);
89-
const shops = await parseShop(shop.data);
89+
const shops = await parseShop(shop);
9090

9191
setLoading(t("fetching.progress"));
9292
const progress = await getProgress(

src/typings/StorefrontV2.d.ts src/typings/StorefrontV3.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { VCurrencies } from "../utils/misc";
22

3-
export interface IStorefrontV2 {
3+
export interface IStorefrontV3 {
44
FeaturedBundle: FeaturedBundle;
55
SkinsPanelLayout: SkinsPanelLayout;
66
BonusStore?: BonusStore;

src/utils/ValorantAPI.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import axios from "axios";
22
import jwtDecode from "jwt-decode";
33
import { getVAPILang, VCurrencies, VItemTypes } from "./misc";
44
import { btoa } from "react-native-quick-base64";
5-
import { IStorefrontV2 } from "../typings/StorefrontV2";
5+
import { IStorefrontV3 } from "../typings/StorefrontV3";
66
import https from "https-browserify";
77

88
axios.interceptors.request.use(
@@ -146,22 +146,22 @@ export async function getShop(
146146
region: string,
147147
userId: string,
148148
) {
149-
const res = await axios.get<IStorefrontV2>(
150-
getUrl("storefront", region, userId),
151-
{
152-
method: "GET",
153-
headers: {
154-
Authorization: `Bearer ${accessToken}`,
155-
"X-Riot-Entitlements-JWT": entitlementsToken,
156-
...extraHeaders,
157-
},
149+
const res = await axios.request<IStorefrontV3>({
150+
url: getUrl("storefront", region, userId),
151+
method: "POST",
152+
headers: {
153+
...extraHeaders,
154+
"Content-Type": "application/json",
155+
Authorization: `Bearer ${accessToken}`,
156+
"X-Riot-Entitlements-JWT": entitlementsToken,
158157
},
159-
);
158+
data: {},
159+
});
160160

161-
return res;
161+
return res.data;
162162
}
163163

164-
export async function parseShop(shop: IStorefrontV2) {
164+
export async function parseShop(shop: IStorefrontV3) {
165165
/* NORMAL SHOP */
166166
let singleItemOffers = shop.SkinsPanelLayout.SingleItemOffers;
167167
let main: IShopItem[] = [];
@@ -321,7 +321,7 @@ function getUrl(name: string, region?: string, userId?: string) {
321321
auth: "https://auth.riotgames.com/api/v1/authorization/",
322322
entitlements: "https://entitlements.auth.riotgames.com/api/token/v1/",
323323
userinfo: "https://auth.riotgames.com/userinfo/",
324-
storefront: `https://pd.${region}.a.pvp.net/store/v2/storefront/${userId}`,
324+
storefront: `https://pd.${region}.a.pvp.net/store/v3/storefront/${userId}`,
325325
wallet: `https://pd.${region}.a.pvp.net/store/v1/wallet/${userId}`,
326326
playerxp: `https://pd.${region}.a.pvp.net/account-xp/v1/players/${userId}`,
327327
weapons: "https://valorant-api.com/v1/weapons/",

src/utils/WishlistServiceTask.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ export default async function () {
5555
const wishlist = useWishlistStore.getState().skinIds;
5656
var hit = false;
5757
for (let i = 0; i < wishlist.length; i++) {
58-
if (
59-
shop.data.SkinsPanelLayout.SingleItemOffers.includes(wishlist[i])
60-
) {
58+
if (shop.SkinsPanelLayout.SingleItemOffers.includes(wishlist[i])) {
6159
const skinData = await axios.get<{
6260
status: number;
6361
data: ISkinLevel;

0 commit comments

Comments
 (0)