Issue-178 Add draft mode for IDE

resolves #178
Initially the UI forced users to create a "part" before they got access
to the ide, now we're letting users go straight to hacking in the ide
and saving can come later. Better at getting users to the code earlier
This commit is contained in:
Kurt Hutten
2020-12-29 18:53:49 +11:00
parent 7f5b48a959
commit c84dcda4a1
9 changed files with 148 additions and 56 deletions

View File

@@ -27,7 +27,7 @@ const UPDATE_PART_MUTATION = gql`
}
}
`
const FORK_PART_MUTATION = gql`
export const FORK_PART_MUTATION = gql`
mutation ForkPartMutation($input: CreatePartInput!) {
forkPart(input: $input) {
id
@@ -62,9 +62,9 @@ export const Success = ({ part, refetch }) => {
},
})
const saveCode = ({ input, id, isFork }) => {
const saveCode = async ({ input, id, isFork }) => {
if (!isFork) {
updatePart({ variables: { id, input } })
await updatePart({ variables: { id, input } })
refetch()
return
}