Skip to content

Commit 8bc7262

Browse files
handled edge cases
1 parent 652080a commit 8bc7262

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/lib/processSnapshot.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,7 @@ export default class Queue {
227227
const viewportExists = snapshot.options.web.viewports.some(existingViewport =>
228228
existingViewport[0] === width &&
229229
(existingViewport.length < 2 || existingViewport[1] === height)
230-
);
231-
console.log(variant)
232-
console.log(viewportExists)
230+
);
233231
if (!viewportExists) {
234232
if (height > 0) {
235233
snapshot.options.web.viewports.push([width, height]);
@@ -284,7 +282,12 @@ export default class Queue {
284282
let drop = false;
285283

286284
if (snapshot && snapshot.name && this.snapshotNames.includes(snapshot.name)) {
287-
drop = this.filterExistingVariants(snapshot, this.ctx.config);
285+
if (!this.ctx.config.deferUploads){
286+
drop = true;
287+
this.ctx.log.debug(`snapshot failed; Same snapshot has been encountered with defer Uploads being false`);
288+
} else {
289+
drop = this.filterExistingVariants(snapshot, this.ctx.config);
290+
}
288291
}
289292

290293
if (snapshot && snapshot.name && !this.snapshotNames.includes(snapshot.name)) {
@@ -295,9 +298,6 @@ export default class Queue {
295298
this.processGenerateVariants(snapshot);
296299
}
297300

298-
console.log("***********")
299-
console.log(JSON.stringify(snapshot.options))
300-
301301
if (!drop) {
302302
let { processedSnapshot, warnings } = await processSnapshot(snapshot, this.ctx);
303303
await this.ctx.client.uploadSnapshot(this.ctx, processedSnapshot);

0 commit comments

Comments
 (0)