Skip to content
Snippets Groups Projects
Commit ee0effda authored by Midhun Suresh's avatar Midhun Suresh
Browse files

Fix navigation

parent e75b62e8
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,10 @@ export class AccountSetupViewModel extends ViewModel { ...@@ -57,6 +57,10 @@ export class AccountSetupViewModel extends ViewModel {
this._state.set("timeline"); this._state.set("timeline");
} }
dismiss() {
this._state.set("start");
}
private get _homeserver(): string { private get _homeserver(): string {
return this._config.homeserver; return this._config.homeserver;
} }
......
...@@ -18,16 +18,16 @@ export class RootViewModel extends ViewModel { ...@@ -18,16 +18,16 @@ export class RootViewModel extends ViewModel {
super(options); super(options);
this._config = config; this._config = config;
this._client = new Client(this.platform); this._client = new Client(this.platform);
this._state.subscribe(stage => this._applyNavigation(stage));
} }
async start() { async start() {
this._state.subscribe(stage => this._applyNavigation(stage));
const sessionAlreadyExists = await this.attemptStartWithExistingSession(); const sessionAlreadyExists = await this.attemptStartWithExistingSession();
if (sessionAlreadyExists) { if (sessionAlreadyExists) {
this._showTimeline(); this._state.set("timeline");
return; return;
} }
this._showAccountSetup(); this._state.set("account-setup");
} }
private _applyNavigation(stage: string) { private _applyNavigation(stage: string) {
...@@ -35,6 +35,12 @@ export class RootViewModel extends ViewModel { ...@@ -35,6 +35,12 @@ export class RootViewModel extends ViewModel {
case "timeline": case "timeline":
this._showTimeline(); this._showTimeline();
break; break;
case "start":
this._showStartButton();
break;
case "account-setup":
this._showAccountSetup();
break;
} }
} }
...@@ -57,6 +63,11 @@ export class RootViewModel extends ViewModel { ...@@ -57,6 +63,11 @@ export class RootViewModel extends ViewModel {
this.emitChange("activeSection"); this.emitChange("activeSection");
} }
private _showStartButton() {
this._activeSection = "start";
this.emitChange("activeSection");
}
/** /**
* Try to start Hydrogen based on an existing hydrogen session. * Try to start Hydrogen based on an existing hydrogen session.
* If multiple sessions exist, this method chooses the most recent one. * If multiple sessions exist, this method chooses the most recent one.
......
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