feat: add Revolt discover (note: has CORS issues)

This commit is contained in:
Paul Makles
2022-01-10 00:57:00 +00:00
parent 56925b3ea2
commit abecd0ec11
7 changed files with 172 additions and 33 deletions

View File

@@ -27,7 +27,7 @@ export default class Layout implements Store, Persistent<Data> {
* The last 'major section' that the user had open.
* This is either the home tab or a channel ID (for a server channel).
*/
private lastSection: "home" | string;
private lastSection: "home" | "discover" | string;
/**
* The last path the user had open in the home tab.
@@ -143,9 +143,19 @@ export default class Layout implements Store, Persistent<Data> {
* @returns Last path
*/
@computed getLastPath() {
return this.lastSection === "home"
? this.lastHomePath
: this.getLastOpened(this.lastSection);
return this.lastSection === "discover"
? "/discover"
: this.lastSection === "home"
? this.lastHomePath!
: this.getLastOpened(this.lastSection)!;
}
/**
* Set the last opened section.
* @param section Section name
*/
@action setLastSection(section: string) {
this.lastSection = section;
}
/**