Skip to content

Commit

Permalink
chore: skipping prompting was missing somewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
sneko committed Aug 1, 2024
1 parent 63b196b commit 9cbc0e7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/features/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,20 @@ export async function transform(options: TransformOptionsType) {

const advisedElementsLimit = 150_000;
if (elementsCount > advisedElementsLimit) {
const answer = await confirm({
message: `The Figma document tree you want to synchronize is really huge. Over ${advisedElementsLimit} elements we are quick sure both the Penpot backend and the frontend won't be able to render your document until Penpot evolves. Have a look at our documentation to see how to exclude nodes that bring to you no value and that could make the document loadable. Do you want to by-pass this warning and continue processing an unloadable file?`,
});
if (options.prompting) {
const answer = await confirm({
message: `The Figma document tree you want to synchronize is really huge. Over ${advisedElementsLimit} elements we are quick sure both the Penpot backend and the frontend won't be able to render your document until Penpot evolves. Have a look at our documentation to see how to exclude nodes that bring to you no value and that could make the document loadable. Do you want to by-pass this warning and continue processing an unloadable file?`,
});

if (!answer) {
console.warn('the transformation operation has been aborted');
if (!answer) {
console.warn('the transformation operation has been aborted');

return Promise.reject(gracefulExit);
return Promise.reject(gracefulExit);
}
} else {
console.warn(
`the Figma document tree you want to synchronize is really huge. Over ${advisedElementsLimit} elements we are quick sure both the Penpot backend and the frontend won't be able to render your document until Penpot evolves. Have a look at our documentation to see how to exclude nodes that bring to you no value and that could make the document loadable`
);
}
}

Expand Down

0 comments on commit 9cbc0e7

Please sign in to comment.