mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
fix errors
This commit is contained in:
parent
5c7a1f66d6
commit
d6857a1ede
@ -7,7 +7,7 @@ async function getLoginData(username, password) {
|
|||||||
const storedCredentials = localStorage.getItem("morpheus_login");
|
const storedCredentials = localStorage.getItem("morpheus_login");
|
||||||
if (!storedCredentials) {
|
if (!storedCredentials) {
|
||||||
const api = new Network(HOMESERVER);
|
const api = new Network(HOMESERVER);
|
||||||
loginData = await api.passwordLogin(username, password).response();
|
const loginData = await api.passwordLogin(username, password).response();
|
||||||
localStorage.setItem("morpheus_login", JSON.stringify(loginData));
|
localStorage.setItem("morpheus_login", JSON.stringify(loginData));
|
||||||
return loginData;
|
return loginData;
|
||||||
} else {
|
} else {
|
||||||
|
@ -10,8 +10,8 @@ export function openDatabase(name, createObjectStore, version = undefined) {
|
|||||||
|
|
||||||
export function reqAsPromise(req) {
|
export function reqAsPromise(req) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
txn.addEventListener("success", event => resolve(event.target.result));
|
req.addEventListener("success", event => resolve(event.target.result));
|
||||||
txn.addEventListener("error", event => reject(event.target.error));
|
req.addEventListener("error", event => reject(event.target.error));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user