Skip to content

Commit 622310c

Browse files
committed
perf: rm detectSnapshot
1 parent cf017d7 commit 622310c

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

src/store/snapshot.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ export const useSnapshotStore = defineStore('snapshot', () => {
102102
snapshotId.value
103103
) {
104104
importSnapshotId[importId.value] = snapshotId.value;
105-
fetch(
106-
`https://detect.gkd.li/api/detectSnapshot?importId=` + importId.value,
107-
);
108105
}
109106
});
110107
const autoUpload = computed(() => {

src/utils/export.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
import Compressor from 'compressorjs';
12
import { saveAs } from 'file-saver';
23
import pLimit from 'p-limit';
4+
import { JSZipAsync } from './chunk';
35
import { uploadAsset } from './github';
4-
import { delay, obj2usp } from './others';
6+
import { delay } from './others';
57
import { screenshotStorage, snapshotStorage } from './snapshot';
6-
import Compressor from 'compressorjs';
78
import type { Snapshot } from './types';
89
import { getImageId } from './url';
9-
import { JSZipAsync } from './chunk';
1010

1111
const snapshotAsZip = async (snapshot: Snapshot) => {
1212
if (!snapshot.nodes.length) {
@@ -112,7 +112,6 @@ export const exportSnapshotAsImportId = async (snapshot: Snapshot) => {
112112
).then((r) => {
113113
snapshotImportId[snapshot.id] = r.id;
114114
importSnapshotId[r.id] = snapshot.id;
115-
detectFetchSnapshot(snapshot.id, r.id);
116115
return r.id;
117116
})
118117
);
@@ -145,15 +144,6 @@ export const batchCreateZipUrl = async (snapshots: Snapshot[]) => {
145144
}, []);
146145
};
147146

148-
const detectFetchSnapshot = async (id: number, importId: number | string) => {
149-
return fetch(
150-
`https://detect.gkd.li/api/detectSnapshot?` +
151-
obj2usp({
152-
id,
153-
importId,
154-
}).toString(),
155-
);
156-
};
157147
export const detectSnapshot = async (
158148
id: number,
159149
importId: number | string | undefined,
@@ -167,5 +157,4 @@ export const detectSnapshot = async (
167157
if (importSnapshotId[importId]) {
168158
return;
169159
}
170-
await detectFetchSnapshot(id, importId);
171160
};

src/utils/url.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const corsOkOrigins = new Set([
1212
`https://gist.githubusercontent.com`,
1313
`https://raw.gitmirror.com`,
1414
`https://registry.npmmirror.com`,
15-
'https://detect.gkd.li',
1615
]);
1716

1817
export const isAllowCorsUrl = (targetUrl: string | URL) => {

0 commit comments

Comments
 (0)