Skip to content

Commit fabaad0

Browse files
committed
bug修复
1 parent 95d91ca commit fabaad0

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

electron/lcu/lcuRequest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ export const getCustomRunes = async (champId: number) => {
335335

336336
export const getOPGGRunes = async (champId: number) => {
337337
const championData = await getChampData(champId);
338-
const gameMode = getGameModeByQueue(await getCurrentQueue()) || "RANK";
339-
const position = championData?.positions.map((p) => p.name)[0] || "MID";
340-
if (gameMode === "RANK") {
338+
const gameMode = getGameModeByQueue(await getCurrentQueue()) || "rank";
339+
const position = championData?.positions.map((p) => p.name)[0] || "mid";
340+
if (gameMode === "rank") {
341341
return await getRankRunes(champId, position);
342342
} else {
343343
return await getNoneRankRunes(champId, gameMode);

electron/lcu/opgg_rank_type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type PositionName = "ADC" | "JUNGLE" | "MID" | "SUPPORT" | "TOP";
1+
export type PositionName = "adc" | "jungle" | "mid" | "support" | "top";
22
export type GameMode = "rank" | "aram" | "urf";
33
export type RoleType = keyof typeof roleMap;
44
export const roleMap = {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "joi",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"main": "dist-electron/main.js",
55
"repository": {
66
"type": "git",

src/api/lcuApi.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ async function captureError<T>(func: Function | Promise<T>, ...args: any[]) {
1616
message.error("客户端未连接,LCU api不可用!");
1717
return;
1818
}
19-
if (func instanceof Promise) {
20-
try {
19+
try {
20+
if (func instanceof Promise) {
2121
return await func;
22-
} catch (err) {
23-
if (err instanceof Error) {
24-
message.error(err.message);
25-
}
26-
throw err;
22+
} else {
23+
return func(...args) as T;
2724
}
28-
} else {
29-
return func(...args) as T;
25+
} catch (err) {
26+
if (err instanceof Error) {
27+
message.error(err.message);
28+
}
29+
console.log("an error occurred: ", err);
30+
throw err;
3031
}
3132
}
3233

src/components/EpicLoading.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const props = defineProps<{ loading: boolean }>();
2020
align-items: center;
2121
justify-content: center;
2222
backdrop-filter: blur(4px);
23-
z-index: 99999;
23+
z-index: 100;
2424
"
2525
>
2626
<slot name="loading">

0 commit comments

Comments
 (0)