瀏覽代碼

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.
master
Saúl Ibarra Corretgé 5 年之前
父節點
當前提交
062bc13d4f
共有 2 個文件被更改,包括 3 次插入8 次删除
  1. 0
    8
      react/features/base/lib-jitsi-meet/native/polyfills-browser.js
  2. 3
    0
      react/index.native.js

+ 0
- 8
react/features/base/lib-jitsi-meet/native/polyfills-browser.js 查看文件

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

+ 3
- 0
react/index.native.js 查看文件

10
 // collect the polyfills' files.
10
 // collect the polyfills' files.
11
 import './features/base/lib-jitsi-meet/native/polyfills-bundler';
11
 import './features/base/lib-jitsi-meet/native/polyfills-bundler';
12
 
12
 
13
+// Polyfill localStorage early so any library that requires it sees it available.
14
+import './features/base/storage/native/polyfills-browser';
15
+
13
 import React, { PureComponent } from 'react';
16
 import React, { PureComponent } from 'react';
14
 import { AppRegistry } from 'react-native';
17
 import { AppRegistry } from 'react-native';
15
 
18
 

Loading…
取消
儲存