Skip to content

Commit

Permalink
fix: snapshotAsZip
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Jan 17, 2025
1 parent af7e01b commit 1bc3273
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import { saveAs } from 'file-saver';
import pLimit from 'p-limit';
import { uploadAsset } from './github';
import { delay, obj2usp } from './others';
import { screenshotStorage } from './snapshot';
import { screenshotStorage, snapshotStorage } from './snapshot';
import Compressor from 'compressorjs';
import type { Snapshot } from './types';
import { getImageId } from './url';
import { JSZipAsync } from './chunk';

const snapshotAsZip = async (snapshot: Snapshot) => {
if (!snapshot.nodes.length) {
snapshot = (await snapshotStorage.getItem(snapshot.id)) || snapshot;
}
const zip = new (await JSZipAsync)();
zip
.file(`snapshot.json`, JSON.stringify(snapshot))
Expand Down

0 comments on commit 1bc3273

Please sign in to comment.