fix persistent peerId if PWA
This commit is contained in:
parent
bf79f72741
commit
88e31407cb
|
@ -114,7 +114,7 @@ class ServerConnection {
|
||||||
|
|
||||||
_onDisplayName(msg) {
|
_onDisplayName(msg) {
|
||||||
sessionStorage.setItem("peerId", msg.message.peerId);
|
sessionStorage.setItem("peerId", msg.message.peerId);
|
||||||
if (window.matchMedia('(display-mode: standalone)').matches) {
|
if (window.matchMedia('(display-mode: minimal-ui)').matches) {
|
||||||
// make peerId persistent when pwa installed
|
// make peerId persistent when pwa installed
|
||||||
PersistentStorage.set('peerId', msg.message.peerId).then(peerId => {
|
PersistentStorage.set('peerId', msg.message.peerId).then(peerId => {
|
||||||
console.log(`peerId saved to indexedDB: ${peerId}`);
|
console.log(`peerId saved to indexedDB: ${peerId}`);
|
||||||
|
|
Loading…
Reference in New Issue