Skip to content
Snippets Groups Projects
Commit 7caca95c authored by Maximilian Giller's avatar Maximilian Giller :squid:
Browse files

Improved handling of deleting last space

parent 148f302a
No related branches found
No related tags found
No related merge requests found
Pipeline #57035 passed
...@@ -462,9 +462,12 @@ export class Editor extends React.PureComponent<any, stateTypes> { ...@@ -462,9 +462,12 @@ export class Editor extends React.PureComponent<any, stateTypes> {
private deleteSpace(spaceId: string): Promise<void> { private deleteSpace(spaceId: string): Promise<void> {
return deleteGraphJson(spaceId).then(() => { return deleteGraphJson(spaceId).then(() => {
// Select first space in list if available, otherwise select defaul space (which will be created) // Select first space in list if available, otherwise select defaul space (which will be created)
const remainingSpacesList: string[] = this.state.spaces.filter(
(space: string) => space != spaceId
);
const selectSpaceId: string = const selectSpaceId: string =
this.state.spaces.length > 0 remainingSpacesList.length > 0
? this.state.spaces[0] ? remainingSpacesList[0]
: Config.SPACE; : Config.SPACE;
this.loadSpace(selectSpaceId); this.loadSpace(selectSpaceId);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment