Remove pre populated namespace

This commit is contained in:
loganhz 2018-06-20 11:26:24 +08:00
parent 6948525c19
commit fcf07da943
2 changed files with 6 additions and 2 deletions

View File

@ -175,7 +175,12 @@ export default Route.extend({
}
if (!ns) {
ns = clusterStore.getById('namespace', get(this, `prefs.${C.PREFS.LAST_NAMESPACE}`));
const project = window.l('route:application').modelFor('authenticated.project').get('project');
const projectId = project.get('id');
const lastNamespace = clusterStore.getById('namespace', get(this, `prefs.${C.PREFS.LAST_NAMESPACE}`));
if ( lastNamespace && get(lastNamespace, 'projectId') === projectId ) {
ns = lastNamespace;
}
}
let namespaceId = null;

View File

@ -61,7 +61,6 @@ export default Component.extend({
} else {
next(() => {
set(this, 'mode', CREATE);
set(this, 'createNamespace.name', 'default')
});
}