Skip to content

Commit 2ed4b67

Browse files
committed
🐛fix(sources): 修复谱面获取的bug
1 parent 0006440 commit 2ed4b67

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

src/utils/chartSource.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
export const chartSource = () => {
1+
function isCloudflarePages() {
2+
return window.location.hostname.includes('cf');
3+
}
4+
function isVercel() {
5+
return window.location.hostname.includes('vercel');
6+
}
7+
function isEdgeOne() {
8+
return window.location.hostname.includes('eo');
9+
}
10+
11+
export function getChartSource() {
212
if (isCloudflarePages()) {
313
return process.env.CHARTS_SOURCE_CF;
414
} else if (isVercel()) {
@@ -10,12 +20,6 @@ export const chartSource = () => {
1020
}
1121
}
1222

13-
function isCloudflarePages() {
14-
return window.location.hostname.includes('cf');
15-
}
16-
function isVercel() {
17-
return window.location.hostname.includes('vercel');
18-
}
19-
function isEdgeOne() {
20-
return window.location.hostname.includes('eo');
21-
}
23+
24+
export const chartSource = getChartSource();
25+

0 commit comments

Comments
 (0)