forked from abner/for-legacy-web
feat: make login functional again
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { action, computed, makeAutoObservable } from "mobx";
|
||||
import { Client } from "revolt.js";
|
||||
import { API, Client } from "revolt.js";
|
||||
|
||||
type State = "Ready" | "Connecting" | "Online" | "Disconnected" | "Offline";
|
||||
|
||||
type Transition =
|
||||
| {
|
||||
action: "LOGIN";
|
||||
session: SessionPrivate;
|
||||
apiUrl?: string;
|
||||
session: SessionPrivate;
|
||||
configuration?: API.RevoltConfig;
|
||||
}
|
||||
| {
|
||||
action:
|
||||
@@ -113,6 +114,10 @@ export default class Session {
|
||||
this.state = "Connecting";
|
||||
this.createClient(data.apiUrl);
|
||||
|
||||
if (data.configuration) {
|
||||
this.client!.configuration = data.configuration;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.client!.useExistingSession(data.session);
|
||||
this.user_id = this.client!.user!._id;
|
||||
|
||||
Reference in New Issue
Block a user