Skip to content

fix(site): Fix template version editor rename #6251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
BrunoQuaresma committed Feb 21, 2023
commit 4ce0baf99dbc856bcc73963fc715f33aa63e8b7e
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,17 @@ export const templateVersionEditorMachine = createMachine(
}
// Add the editable files
traverse(fileTree, (content, _filename, fullPath) => {
// When a file is deleted. Don't add it to the tar.
if (content === undefined) {
return
}

if (typeof content === "string") {
tar.addFile(fullPath, content)
} else {
tar.addFolder(fullPath)
return
}

tar.addFolder(fullPath)
})
const blob = await tar.write()
return API.uploadTemplateFile(new File([blob], "template.tar"))
Expand Down