Skip to content

Fix/disposable #12

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 5 commits into from
Jul 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

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
prevent loading multiple CR instances
  • Loading branch information
ShMcK committed Jul 14, 2019
commit 0d5f47b4646aa7570a9588feb3a49ff395fef3b9
4 changes: 4 additions & 0 deletions src/editor/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ let webview: any
export const createCommands = ({ context, machine, storage, git, position }: CreateCommandProps) => ({
// initialize
[COMMANDS.START]: () => {
if (webview) {
console.log('CodeRoad already loaded')
return
}
// set local storage workspace
setStorage(context.workspaceState)

Expand Down
1 change: 1 addition & 0 deletions web-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const App = () => {
const [state, setState] = React.useState(initialState)
const [data, setData]: [CR.MachineContext, (data: CR.MachineContext) => void] = React.useState(initialData)

// update state based on response from editor
const handleEvent = (event: ReceivedEvent): void => {
const message = event.data
console.log('RECEIVED')
Expand Down