             error            : ''
 
     create_project: ->
+        token = misc.uuid()
         @setState(state:'saving')
-        salvus_client.create_project
+        actions.create_project
             title       : @state.title_text
             description : @state.description_text
-            public      : false
-            cb          : (err, resp) =>
-                if not err and resp.error
-                    err = misc.to_json(resp.error)
-                if err?
-                    @setState
-                        state : 'edit'
-                        error : "Error creating project -- #{err}"
-                else
-                    @setState
-                        state            : 'view'
-                        title_text       : ''
-                        description_text : ''
-                        error            : ''
+            token       : token
+        store.wait_until_project_created token, 30, (err) =>
+            if err?
+                @setState
+                    state : 'edit'
+                    error : "Error creating project -- #{err}"
+            else
+                @setState
+                    state            : 'view'
+                    title_text       : ''
+                    description_text : ''
+                    error            : ''
 
     render_create_project_button: ->
         if @state.title_text == '' or @state.state == 'saving'


    get_project_open_state: (project_id) =>
        return @get_project_state(project_id, 'open')

# Register projects store
store = flux.createStore('projects', ProjectsStore, flux)


MAX_DEFAULT_PROJECTS = 50

_create_project_tokens = {}

# Define projects actions
class ProjectsActions extends Actions
    # Local state events
