fixes for mobile errors (#115)
This commit is contained in:
parent
3ab065b11a
commit
e07ab27b13
3 changed files with 21 additions and 13 deletions
31
dist/bundle.js
vendored
31
dist/bundle.js
vendored
|
@ -1974,9 +1974,11 @@ module.exports = v4;
|
|||
// and inconsistent support for the `crypto` API. We do the best we can via
|
||||
// feature-detection
|
||||
|
||||
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
||||
var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) ||
|
||||
(typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto));
|
||||
// getRandomValues needs to be invoked in a context where "this" is a Crypto
|
||||
// implementation. Also, find the complete implementation of crypto on IE11.
|
||||
var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
|
||||
(typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
|
||||
|
||||
if (getRandomValues) {
|
||||
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
|
||||
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
|
||||
|
@ -2019,14 +2021,15 @@ for (var i = 0; i < 256; ++i) {
|
|||
function bytesToUuid(buf, offset) {
|
||||
var i = offset || 0;
|
||||
var bth = byteToHex;
|
||||
return bth[buf[i++]] + bth[buf[i++]] +
|
||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
||||
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
||||
bth[buf[i++]] + bth[buf[i++]] +
|
||||
bth[buf[i++]] + bth[buf[i++]] +
|
||||
bth[buf[i++]] + bth[buf[i++]];
|
||||
// join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
|
||||
return ([bth[buf[i++]], bth[buf[i++]],
|
||||
bth[buf[i++]], bth[buf[i++]], '-',
|
||||
bth[buf[i++]], bth[buf[i++]], '-',
|
||||
bth[buf[i++]], bth[buf[i++]], '-',
|
||||
bth[buf[i++]], bth[buf[i++]], '-',
|
||||
bth[buf[i++]], bth[buf[i++]],
|
||||
bth[buf[i++]], bth[buf[i++]],
|
||||
bth[buf[i++]], bth[buf[i++]]]).join('');
|
||||
}
|
||||
|
||||
module.exports = bytesToUuid;
|
||||
|
@ -2484,6 +2487,10 @@ Lbry.transaction_list = function () {
|
|||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
return daemonCallWithResult('transaction_list', params);
|
||||
};
|
||||
Lbry.utxo_release = function () {
|
||||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
return daemonCallWithResult('utxo_release', params);
|
||||
};
|
||||
|
||||
Lbry.connectPromise = null;
|
||||
Lbry.connect = function () {
|
||||
|
@ -3679,7 +3686,7 @@ var selectCurrentPath = exports.selectCurrentPath = (0, _reselect.createSelector
|
|||
});
|
||||
|
||||
var computePageFromPath = exports.computePageFromPath = function computePageFromPath(path) {
|
||||
return path.replace(/^\//, '').split('?')[0];
|
||||
return path ? path.replace(/^\//, '').split('?')[0] : 1;
|
||||
};
|
||||
|
||||
var selectCurrentPage = exports.selectCurrentPage = (0, _reselect.createSelector)(selectCurrentPath, function (path) {
|
||||
|
|
|
@ -89,6 +89,7 @@ Lbry.claim_tip = (params = {}) => daemonCallWithResult('claim_tip', params);
|
|||
|
||||
// transactions
|
||||
Lbry.transaction_list = (params = {}) => daemonCallWithResult('transaction_list', params);
|
||||
Lbry.utxo_release = (params = {}) => daemonCallWithResult('utxo_release', params);
|
||||
|
||||
Lbry.connectPromise = null;
|
||||
Lbry.connect = () => {
|
||||
|
|
|
@ -5,7 +5,7 @@ export const selectState = state => state.navigation || {};
|
|||
|
||||
export const selectCurrentPath = createSelector(selectState, state => state.currentPath);
|
||||
|
||||
export const computePageFromPath = path => path.replace(/^\//, '').split('?')[0];
|
||||
export const computePageFromPath = path => (path ? path.replace(/^\//, '').split('?')[0] : '');
|
||||
|
||||
export const selectCurrentPage = createSelector(selectCurrentPath, path =>
|
||||
computePageFromPath(path)
|
||||
|
|
Loading…
Reference in a new issue