mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-25 16:40:58 -05:00
fix: fix server last section state
This commit is contained in:
parent
07870c849d
commit
5a49bc7d20
1 changed files with 10 additions and 6 deletions
|
@ -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.lastSection === "discover"
|
||||||
? this.lastDiscoverPath
|
? this.lastDiscoverPath
|
||||||
: this.lastSection === "home"
|
: this.lastSection === "home"
|
||||||
? this.lastHomePath
|
? this.lastHomePath
|
||||||
: this.getLastOpened(this.lastSection)!;
|
: this.getServerPath(this.lastSection)!) ??
|
||||||
|
this.lastHomePath ??
|
||||||
|
"/"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue