1+ import Compressor from 'compressorjs' ;
12import { saveAs } from 'file-saver' ;
23import pLimit from 'p-limit' ;
4+ import { JSZipAsync } from './chunk' ;
35import { uploadAsset } from './github' ;
4- import { delay , obj2usp } from './others' ;
6+ import { delay } from './others' ;
57import { screenshotStorage , snapshotStorage } from './snapshot' ;
6- import Compressor from 'compressorjs' ;
78import type { Snapshot } from './types' ;
89import { getImageId } from './url' ;
9- import { JSZipAsync } from './chunk' ;
1010
1111const 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- } ;
157147export 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} ;
0 commit comments