 actions         = require 'app/flux/environment/actions'
 globals         = require 'globals'
 Machine         = require 'app/providers/machine'
+isKoding        = require 'app/util/isKoding'
 lazyrouter      = require 'app/lazyrouter'
 dataProvider    = require 'app/userenvironmentdataprovider'
 registerRoutes  = require 'app/util/registerRoutes'

  else if machineLabel and workspaceSlug
    dataProvider.fetchMachineByLabel machineLabel, (machine, workspace) =>
      if machine and workspace
        actions.setSelectedWorkspaceId worksace._id
        router.handleRoute "/IDE/#{machineLabel}/#{workspaceSlug}"
      else if machine
        routeToMachineWorkspace machine


        dataProvider.ensureDefaultWorkspace ->

          dataProvider.fetchWorkspaceByMachineUId data, (workspace) =>
            if workspace
              loadIDE { machine, workspace, username }
            else
              routeToMachineWorkspace machine

            dataProvider.fetchWorkspaceByMachineUId data, (workspace) =>
              if workspace then loadIDE { machine, workspace, username }
