Implement mobile connection resumes

This commit is contained in:
2022-08-27 02:59:38 +02:00
parent 426e120e21
commit 5fdf49555f
3 changed files with 89 additions and 9 deletions

View File

@ -29,6 +29,18 @@ export class App {
this.handleUrl(document.URL);
}
close() {
if (this.session) this.session.close();
}
sleep() {
if (this.session) this.session.sleep();
}
async wakeup() {
if (this.session) await this.session.wakeup();
}
setHash(hash: string) {
const url = new URL(document.URL);
url.hash = hash;
@ -244,8 +256,8 @@ export class App {
}
});
this.session.subscribe(response => {
this.addMessage(response.data.data.message);
this.session.subscribe(event => {
this.addMessage(event.data.message);
});
}
}