mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
fix: fix server last section state
This commit is contained in:
@@ -133,7 +133,7 @@ export default class Layout implements Store, Persistent<Data> {
|
|||||||
*/
|
*/
|
||||||
@action setLastOpened(server: string, channel: string) {
|
@action setLastOpened(server: string, channel: string) {
|
||||||
this.lastOpened.set(server, channel);
|
this.lastOpened.set(server, channel);
|
||||||
this.lastSection = "server";
|
this.lastSection = server;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -149,11 +149,15 @@ export default class Layout implements Store, Persistent<Data> {
|
|||||||
* @returns Last path
|
* @returns Last path
|
||||||
*/
|
*/
|
||||||
@computed getLastPath() {
|
@computed getLastPath() {
|
||||||
return this.lastSection === "discover"
|
return (
|
||||||
? this.lastDiscoverPath
|
(this.lastSection === "discover"
|
||||||
: this.lastSection === "home"
|
? this.lastDiscoverPath
|
||||||
? this.lastHomePath
|
: this.lastSection === "home"
|
||||||
: this.getLastOpened(this.lastSection)!;
|
? this.lastHomePath
|
||||||
|
: this.getServerPath(this.lastSection)!) ??
|
||||||
|
this.lastHomePath ??
|
||||||
|
"/"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user