rn,storage: fix not using a persistent localStorage

In
1ffd75c0a6
we switched to using the localStorage wrapper provided by js-utils, which
checks for window.localStorage's availability very early. Our polyfill must be
applied earlier that any such import.

Here we are importing it in the entrypoint, which means no code ran before this,
literally.
This commit is contained in:
Saúl Ibarra Corretgé 2020-05-06 10:53:23 +02:00 committed by Saúl Ibarra Corretgé
parent a56e451536
commit 062bc13d4f
2 changed files with 3 additions and 8 deletions

View File

@ -3,14 +3,6 @@ import '@webcomponents/url'; // Polyfill for URL constructor
import { Platform } from '../../react';
// XXX The library lib-jitsi-meet utilizes window.localStorage at the time of
// this writing and, consequently, the browser-related polyfills implemented
// here by the feature base/lib-jitsi-meet for the purposes of the library
// lib-jitsi-meet are incomplete without the Web Storage API! Should the library
// lib-jitsi-meet (and its dependencies) stop utilizing window.localStorage,
// the following import may be removed:
import '../../storage';
/**
* Gets the first common prototype of two specified Objects (treating the
* objects themselves as prototypes as well).

View File

@ -10,6 +10,9 @@
// collect the polyfills' files.
import './features/base/lib-jitsi-meet/native/polyfills-bundler';
// Polyfill localStorage early so any library that requires it sees it available.
import './features/base/storage/native/polyfills-browser';
import React, { PureComponent } from 'react';
import { AppRegistry } from 'react-native';