|
@@ -11,7 +11,7 @@ import requestFunc from "./requestFunc";
|
|
|
import CallScreen from "./CallScreen";
|
|
|
import personIcon from "./person_icon.png";
|
|
|
import { setPushGateway } from "./utils.js";
|
|
|
-import * as localforage from "localforage";
|
|
|
+import { getItem, setItem, removeItem } from "localforage";
|
|
|
import * as matrixcs from "matrix-js-sdk";
|
|
|
|
|
|
function makeCallScreen(call, softKeyRef, callEndCb, incoming) {
|
|
@@ -117,7 +117,7 @@ class Matrix extends Component {
|
|
|
/>
|
|
|
);
|
|
|
this.callScreen = null;
|
|
|
- localforage.getItem("pushregistered").then((value) => {
|
|
|
+ getItem("pushregistered").then((value) => {
|
|
|
if (navigator.serviceWorker && window.PushManager && !value) {
|
|
|
navigator.serviceWorker
|
|
|
.register("/service-worker.js")
|
|
@@ -141,7 +141,7 @@ class Matrix extends Component {
|
|
|
data: { url: window.pushGateway, format: "event_id_only" },
|
|
|
})
|
|
|
.then(() => {
|
|
|
- localforage.setItem("pushregistered", true).then(() => {
|
|
|
+ setItem("pushregistered", true).then(() => {
|
|
|
console.log("Finally did the push notification job!");
|
|
|
});
|
|
|
})
|
|
@@ -196,7 +196,7 @@ class Matrix extends Component {
|
|
|
});
|
|
|
client.on("Session.logged_out", () => {
|
|
|
console.log("Logging out"); // FIXME
|
|
|
- localforage.removeItem("login").then(() => {
|
|
|
+ removeItem("login").then(() => {
|
|
|
window.location = window.location; // eslint-disable-line no-self-assign
|
|
|
});
|
|
|
});
|