- {__("Email")} {__("if you did not receive or are having trouble with your code.")}
+ {__("Email")}{" "}
+ {" "}
+ {__("if you did not receive or are having trouble with your code.")}
diff --git a/ui/js/component/welcomeModal/view.jsx b/ui/js/component/welcomeModal/view.jsx
index 2e71f9e3e..9b6930bc6 100644
--- a/ui/js/component/welcomeModal/view.jsx
+++ b/ui/js/component/welcomeModal/view.jsx
@@ -13,12 +13,16 @@ class WelcomeModal extends React.PureComponent {
{__("Welcome to LBRY.")}
- {__("Using LBRY is like dating a centaur. Totally normal up top, and")}
+ {__(
+ "Using LBRY is like dating a centaur. Totally normal up top, and"
+ )}
{" "}{__("way different")} {__("underneath.")}
{__("Up top, LBRY is similar to popular media sites.")}
- {__("Below, LBRY is controlled by users -- you -- via blockchain and decentralization.")}
+ {__(
+ "Below, LBRY is controlled by users -- you -- via blockchain and decentralization."
+ )}
{__("Thank you for making content freedom possible!")}
@@ -50,16 +54,24 @@ class WelcomeModal extends React.PureComponent {
{" "}{__("LBRY credits, or")} {__("LBC")}.
- {__("This reward will show in your Wallet momentarily, probably while you are reading this message.")}
+ {__(
+ "This reward will show in your Wallet momentarily, probably while you are reading this message."
+ )}
- {__("LBC is used to compensate creators, to publish, and to have say in how the network works.")}
+ {__(
+ "LBC is used to compensate creators, to publish, and to have say in how the network works."
+ )}
- {__("No need to understand it all just yet! Try watching or downloading something next.")}
+ {__(
+ "No need to understand it all just yet! Try watching or downloading something next."
+ )}
- {__("Finally, know that LBRY is an early beta and that it earns the name.")}
+ {__(
+ "Finally, know that LBRY is an early beta and that it earns the name."
+ )}
;
diff --git a/ui/js/jsonrpc.js b/ui/js/jsonrpc.js
index b07dbe547..d401d2eaf 100644
--- a/ui/js/jsonrpc.js
+++ b/ui/js/jsonrpc.js
@@ -1,87 +1,87 @@
const jsonrpc = {};
jsonrpc.call = function(
- connectionString,
- method,
- params,
- callback,
- errorCallback,
- connectFailedCallback,
- timeout
+ connectionString,
+ method,
+ params,
+ callback,
+ errorCallback,
+ connectFailedCallback,
+ timeout
) {
- var xhr = new XMLHttpRequest();
- if (typeof connectFailedCallback !== 'undefined') {
- if (timeout) {
- xhr.timeout = timeout;
- }
+ var xhr = new XMLHttpRequest();
+ if (typeof connectFailedCallback !== "undefined") {
+ if (timeout) {
+ xhr.timeout = timeout;
+ }
- xhr.addEventListener('error', function(e) {
- connectFailedCallback(e);
- });
- xhr.addEventListener('timeout', function() {
- connectFailedCallback(
- new Error(__('XMLHttpRequest connection timed out'))
- );
- });
- }
- xhr.addEventListener('load', function() {
- var response = JSON.parse(xhr.responseText);
+ xhr.addEventListener("error", function(e) {
+ connectFailedCallback(e);
+ });
+ xhr.addEventListener("timeout", function() {
+ connectFailedCallback(
+ new Error(__("XMLHttpRequest connection timed out"))
+ );
+ });
+ }
+ xhr.addEventListener("load", function() {
+ var response = JSON.parse(xhr.responseText);
- if (response.error) {
- if (errorCallback) {
- errorCallback(response.error);
- } else {
- var errorEvent = new CustomEvent('unhandledError', {
- detail: {
- connectionString: connectionString,
- method: method,
- params: params,
- code: response.error.code,
- message: response.error.message,
- data: response.error.data
- }
- });
- document.dispatchEvent(errorEvent);
- }
- } else if (callback) {
- callback(response.result);
- }
- });
+ if (response.error) {
+ if (errorCallback) {
+ errorCallback(response.error);
+ } else {
+ var errorEvent = new CustomEvent("unhandledError", {
+ detail: {
+ connectionString: connectionString,
+ method: method,
+ params: params,
+ code: response.error.code,
+ message: response.error.message,
+ data: response.error.data,
+ },
+ });
+ document.dispatchEvent(errorEvent);
+ }
+ } else if (callback) {
+ callback(response.result);
+ }
+ });
- if (connectFailedCallback) {
- xhr.addEventListener('error', function(event) {
- connectFailedCallback(event);
- });
- } else {
- xhr.addEventListener('error', function(event) {
- var errorEvent = new CustomEvent('unhandledError', {
- detail: {
- connectionString: connectionString,
- method: method,
- params: params,
- code: xhr.status,
- message: __('Connection to API server failed')
- }
- });
- document.dispatchEvent(errorEvent);
- });
- }
+ if (connectFailedCallback) {
+ xhr.addEventListener("error", function(event) {
+ connectFailedCallback(event);
+ });
+ } else {
+ xhr.addEventListener("error", function(event) {
+ var errorEvent = new CustomEvent("unhandledError", {
+ detail: {
+ connectionString: connectionString,
+ method: method,
+ params: params,
+ code: xhr.status,
+ message: __("Connection to API server failed"),
+ },
+ });
+ document.dispatchEvent(errorEvent);
+ });
+ }
- const counter = parseInt(sessionStorage.getItem('JSONRPCCounter') || 0);
+ const counter = parseInt(sessionStorage.getItem("JSONRPCCounter") || 0);
- xhr.open('POST', connectionString, true);
- xhr.send(
- JSON.stringify({
- jsonrpc: '2.0',
- method: method,
- params: params,
- id: counter
- })
- );
+ xhr.open("POST", connectionString, true);
+ xhr.send(
+ JSON.stringify({
+ jsonrpc: "2.0",
+ method: method,
+ params: params,
+ id: counter,
+ })
+ );
- sessionStorage.setItem('JSONRPCCounter', counter + 1);
+ sessionStorage.setItem("JSONRPCCounter", counter + 1);
- return xhr;
+ return xhr;
};
export default jsonrpc;
diff --git a/ui/js/lbry.js b/ui/js/lbry.js
index 3f4feecb7..f4cd7ad67 100644
--- a/ui/js/lbry.js
+++ b/ui/js/lbry.js
@@ -417,7 +417,7 @@ lbry.file_list = function(params = {}) {
return;
}
}
-
+
apiCall(
"file_list",
params,
@@ -458,7 +458,6 @@ lbry.claim_list_mine = function(params = {}) {
});
};
-
lbry._resolveXhrs = {};
lbry.resolve = function(params = {}) {
return new Promise((resolve, reject) => {
diff --git a/ui/js/lbryuri.js b/ui/js/lbryuri.js
index fce46d217..b58ad55ac 100644
--- a/ui/js/lbryuri.js
+++ b/ui/js/lbryuri.js
@@ -26,125 +26,125 @@ const lbryuri = {};
* - channelName (string, if present): Channel name without @
*/
lbryuri.parse = function(uri, requireProto = false) {
- // Break into components. Empty sub-matches are converted to null
- const componentsRegex = new RegExp(
- '^((?:lbry://)?)' + // protocol
- '([^:$#/]*)' + // name (stops at the first separator or end)
- '([:$#]?)([^/]*)' + // modifier separator, modifier (stops at the first path separator or end)
- '(/?)(.*)' // path separator, path
- );
- const [proto, name, modSep, modVal, pathSep, path] = componentsRegex
- .exec(uri)
- .slice(1)
- .map(match => match || null);
+ // Break into components. Empty sub-matches are converted to null
+ const componentsRegex = new RegExp(
+ "^((?:lbry://)?)" + // protocol
+ "([^:$#/]*)" + // name (stops at the first separator or end)
+ "([:$#]?)([^/]*)" + // modifier separator, modifier (stops at the first path separator or end)
+ "(/?)(.*)" // path separator, path
+ );
+ const [proto, name, modSep, modVal, pathSep, path] = componentsRegex
+ .exec(uri)
+ .slice(1)
+ .map(match => match || null);
- let contentName;
+ let contentName;
- // Validate protocol
- if (requireProto && !proto) {
- throw new Error(__('LBRY URIs must include a protocol prefix (lbry://).'));
- }
+ // Validate protocol
+ if (requireProto && !proto) {
+ throw new Error(__("LBRY URIs must include a protocol prefix (lbry://)."));
+ }
- // Validate and process name
- if (!name) {
- throw new Error(__('URI does not include name.'));
- }
+ // Validate and process name
+ if (!name) {
+ throw new Error(__("URI does not include name."));
+ }
- const isChannel = name.startsWith('@');
- const channelName = isChannel ? name.slice(1) : name;
+ const isChannel = name.startsWith("@");
+ const channelName = isChannel ? name.slice(1) : name;
- if (isChannel) {
- if (!channelName) {
- throw new Error(__('No channel name after @.'));
- }
+ if (isChannel) {
+ if (!channelName) {
+ throw new Error(__("No channel name after @."));
+ }
- if (channelName.length < CHANNEL_NAME_MIN_LEN) {
- throw new Error(
- __(
- `Channel names must be at least %s characters.`,
- CHANNEL_NAME_MIN_LEN
- )
- );
- }
+ if (channelName.length < CHANNEL_NAME_MIN_LEN) {
+ throw new Error(
+ __(
+ `Channel names must be at least %s characters.`,
+ CHANNEL_NAME_MIN_LEN
+ )
+ );
+ }
- contentName = path;
- }
+ contentName = path;
+ }
- const nameBadChars = (channelName || name).match(/[^A-Za-z0-9-]/g);
- if (nameBadChars) {
- throw new Error(
- __(
- `Invalid character %s in name: %s.`,
- nameBadChars.length == 1 ? '' : 's',
- nameBadChars.join(', ')
- )
- );
- }
+ const nameBadChars = (channelName || name).match(/[^A-Za-z0-9-]/g);
+ if (nameBadChars) {
+ throw new Error(
+ __(
+ `Invalid character %s in name: %s.`,
+ nameBadChars.length == 1 ? "" : "s",
+ nameBadChars.join(", ")
+ )
+ );
+ }
- // Validate and process modifier (claim ID, bid position or claim sequence)
- let claimId, claimSequence, bidPosition;
- if (modSep) {
- if (!modVal) {
- throw new Error(__(`No modifier provided after separator %s.`, modSep));
- }
+ // Validate and process modifier (claim ID, bid position or claim sequence)
+ let claimId, claimSequence, bidPosition;
+ if (modSep) {
+ if (!modVal) {
+ throw new Error(__(`No modifier provided after separator %s.`, modSep));
+ }
- if (modSep == '#') {
- claimId = modVal;
- } else if (modSep == ':') {
- claimSequence = modVal;
- } else if (modSep == '$') {
- bidPosition = modVal;
- }
- }
+ if (modSep == "#") {
+ claimId = modVal;
+ } else if (modSep == ":") {
+ claimSequence = modVal;
+ } else if (modSep == "$") {
+ bidPosition = modVal;
+ }
+ }
- if (
- claimId &&
- (claimId.length > CLAIM_ID_MAX_LEN || !claimId.match(/^[0-9a-f]+$/))
- ) {
- throw new Error(__(`Invalid claim ID %s.`, claimId));
- }
+ if (
+ claimId &&
+ (claimId.length > CLAIM_ID_MAX_LEN || !claimId.match(/^[0-9a-f]+$/))
+ ) {
+ throw new Error(__(`Invalid claim ID %s.`, claimId));
+ }
- if (claimSequence && !claimSequence.match(/^-?[1-9][0-9]*$/)) {
- throw new Error(__('Claim sequence must be a number.'));
- }
+ if (claimSequence && !claimSequence.match(/^-?[1-9][0-9]*$/)) {
+ throw new Error(__("Claim sequence must be a number."));
+ }
- if (bidPosition && !bidPosition.match(/^-?[1-9][0-9]*$/)) {
- throw new Error(__('Bid position must be a number.'));
- }
+ if (bidPosition && !bidPosition.match(/^-?[1-9][0-9]*$/)) {
+ throw new Error(__("Bid position must be a number."));
+ }
- // Validate and process path
- if (path) {
- if (!isChannel) {
- throw new Error(__('Only channel URIs may have a path.'));
- }
+ // Validate and process path
+ if (path) {
+ if (!isChannel) {
+ throw new Error(__("Only channel URIs may have a path."));
+ }
- const pathBadChars = path.match(/[^A-Za-z0-9-]/g);
- if (pathBadChars) {
- throw new Error(
- __(
- `Invalid character %s in path: %s`,
- count == 1 ? '' : 's',
- nameBadChars.join(', ')
- )
- );
- }
+ const pathBadChars = path.match(/[^A-Za-z0-9-]/g);
+ if (pathBadChars) {
+ throw new Error(
+ __(
+ `Invalid character %s in path: %s`,
+ count == 1 ? "" : "s",
+ nameBadChars.join(", ")
+ )
+ );
+ }
- contentName = path;
- } else if (pathSep) {
- throw new Error(__('No path provided after /'));
- }
+ contentName = path;
+ } else if (pathSep) {
+ throw new Error(__("No path provided after /"));
+ }
- return {
- name,
- path,
- isChannel,
- ...(contentName ? { contentName } : {}),
- ...(channelName ? { channelName } : {}),
- ...(claimSequence ? { claimSequence: parseInt(claimSequence) } : {}),
- ...(bidPosition ? { bidPosition: parseInt(bidPosition) } : {}),
- ...(claimId ? { claimId } : {}),
- ...(path ? { path } : {})
- };
+ return {
+ name,
+ path,
+ isChannel,
+ ...(contentName ? { contentName } : {}),
+ ...(channelName ? { channelName } : {}),
+ ...(claimSequence ? { claimSequence: parseInt(claimSequence) } : {}),
+ ...(bidPosition ? { bidPosition: parseInt(bidPosition) } : {}),
+ ...(claimId ? { claimId } : {}),
+ ...(path ? { path } : {}),
+ };
};
/**
@@ -153,96 +153,96 @@ lbryuri.parse = function(uri, requireProto = false) {
* The channelName key will accept names with or without the @ prefix.
*/
lbryuri.build = function(uriObj, includeProto = true, allowExtraProps = false) {
- let {
- name,
- claimId,
- claimSequence,
- bidPosition,
- path,
- contentName,
- channelName
- } = uriObj;
+ let {
+ name,
+ claimId,
+ claimSequence,
+ bidPosition,
+ path,
+ contentName,
+ channelName,
+ } = uriObj;
- if (channelName) {
- const channelNameFormatted = channelName.startsWith('@')
- ? channelName
- : '@' + channelName;
- if (!name) {
- name = channelNameFormatted;
- } else if (name !== channelNameFormatted) {
- throw new Error(
- __(
- 'Received a channel content URI, but name and channelName do not match. "name" represents the value in the name position of the URI (lbry://name...), which for channel content will be the channel name. In most cases, to construct a channel URI you should just pass channelName and contentName.'
- )
- );
- }
- }
+ if (channelName) {
+ const channelNameFormatted = channelName.startsWith("@")
+ ? channelName
+ : "@" + channelName;
+ if (!name) {
+ name = channelNameFormatted;
+ } else if (name !== channelNameFormatted) {
+ throw new Error(
+ __(
+ 'Received a channel content URI, but name and channelName do not match. "name" represents the value in the name position of the URI (lbry://name...), which for channel content will be the channel name. In most cases, to construct a channel URI you should just pass channelName and contentName.'
+ )
+ );
+ }
+ }
- if (contentName) {
- if (!name) {
- name = contentName;
- } else if (!path) {
- path = contentName;
- }
- if (path && path !== contentName) {
- throw new Error(
- __(
- 'Path and contentName do not match. Only one is required; most likely you wanted contentName.'
- )
- );
- }
- }
+ if (contentName) {
+ if (!name) {
+ name = contentName;
+ } else if (!path) {
+ path = contentName;
+ }
+ if (path && path !== contentName) {
+ throw new Error(
+ __(
+ "Path and contentName do not match. Only one is required; most likely you wanted contentName."
+ )
+ );
+ }
+ }
- return (
- (includeProto ? 'lbry://' : '') +
- name +
- (claimId ? `#${claimId}` : '') +
- (claimSequence ? `:${claimSequence}` : '') +
- (bidPosition ? `\$${bidPosition}` : '') +
- (path ? `/${path}` : '')
- );
+ return (
+ (includeProto ? "lbry://" : "") +
+ name +
+ (claimId ? `#${claimId}` : "") +
+ (claimSequence ? `:${claimSequence}` : "") +
+ (bidPosition ? `\$${bidPosition}` : "") +
+ (path ? `/${path}` : "")
+ );
};
/* Takes a parseable LBRY URI and converts it to standard, canonical format (currently this just
* consists of adding the lbry:// prefix if needed) */
lbryuri.normalize = function(uri) {
- const { name, path, bidPosition, claimSequence, claimId } = lbryuri.parse(
- uri
- );
- return lbryuri.build({ name, path, claimSequence, bidPosition, claimId });
+ const { name, path, bidPosition, claimSequence, claimId } = lbryuri.parse(
+ uri
+ );
+ return lbryuri.build({ name, path, claimSequence, bidPosition, claimId });
};
lbryuri.isValid = function(uri) {
- let parts;
- try {
- parts = lbryuri.parse(lbryuri.normalize(uri));
- } catch (error) {
- return false;
- }
- return parts && parts.name;
+ let parts;
+ try {
+ parts = lbryuri.parse(lbryuri.normalize(uri));
+ } catch (error) {
+ return false;
+ }
+ return parts && parts.name;
};
lbryuri.isValidName = function(name, checkCase = true) {
- const regexp = new RegExp('^[a-z0-9-]+$', checkCase ? '' : 'i');
- return regexp.test(name);
+ const regexp = new RegExp("^[a-z0-9-]+$", checkCase ? "" : "i");
+ return regexp.test(name);
};
lbryuri.isClaimable = function(uri) {
- let parts;
- try {
- parts = lbryuri.parse(lbryuri.normalize(uri));
- } catch (error) {
- return false;
- }
- return (
- parts &&
- parts.name &&
- !parts.claimId &&
- !parts.bidPosition &&
- !parts.claimSequence &&
- !parts.isChannel &&
- !parts.path
- );
+ let parts;
+ try {
+ parts = lbryuri.parse(lbryuri.normalize(uri));
+ } catch (error) {
+ return false;
+ }
+ return (
+ parts &&
+ parts.name &&
+ !parts.claimId &&
+ !parts.bidPosition &&
+ !parts.claimSequence &&
+ !parts.isChannel &&
+ !parts.path
+ );
};
window.lbryuri = lbryuri;
diff --git a/ui/js/lighthouse.js b/ui/js/lighthouse.js
index cfac14a9a..d7052a0ee 100644
--- a/ui/js/lighthouse.js
+++ b/ui/js/lighthouse.js
@@ -1,84 +1,84 @@
-import lbry from './lbry.js';
-import jsonrpc from './jsonrpc.js';
+import lbry from "./lbry.js";
+import jsonrpc from "./jsonrpc.js";
const queryTimeout = 3000;
const maxQueryTries = 2;
const defaultServers = [
- 'http://lighthouse7.lbry.io:50005',
- 'http://lighthouse8.lbry.io:50005',
- 'http://lighthouse9.lbry.io:50005'
+ "http://lighthouse7.lbry.io:50005",
+ "http://lighthouse8.lbry.io:50005",
+ "http://lighthouse9.lbry.io:50005",
];
-const path = '/';
+const path = "/";
let server = null;
let connectTryNum = 0;
function getServers() {
- return lbry.getClientSetting('useCustomLighthouseServers')
- ? lbry.getClientSetting('customLighthouseServers')
- : defaultServers;
+ return lbry.getClientSetting("useCustomLighthouseServers")
+ ? lbry.getClientSetting("customLighthouseServers")
+ : defaultServers;
}
function call(method, params, callback, errorCallback) {
- if (connectTryNum >= maxQueryTries) {
- errorCallback(
- new Error(
- __(
- `Could not connect to Lighthouse server. Last server attempted: %s`,
- server
- )
- )
- );
- return;
- }
+ if (connectTryNum >= maxQueryTries) {
+ errorCallback(
+ new Error(
+ __(
+ `Could not connect to Lighthouse server. Last server attempted: %s`,
+ server
+ )
+ )
+ );
+ return;
+ }
- /**
+ /**
* Set the Lighthouse server if it hasn't been set yet, if the current server is not in current
* set of servers (most likely because of a settings change), or we're re-trying after a failed
* query.
*/
- if (!server || !getServers().includes(server) || connectTryNum > 0) {
- // If there's a current server, filter it out so we get a new one
- const newServerChoices = server
- ? getServers().filter(s => s != server)
- : getServers();
- server =
- newServerChoices[
- Math.round(Math.random() * (newServerChoices.length - 1))
- ];
- }
+ if (!server || !getServers().includes(server) || connectTryNum > 0) {
+ // If there's a current server, filter it out so we get a new one
+ const newServerChoices = server
+ ? getServers().filter(s => s != server)
+ : getServers();
+ server =
+ newServerChoices[
+ Math.round(Math.random() * (newServerChoices.length - 1))
+ ];
+ }
- jsonrpc.call(
- server + path,
- method,
- params,
- response => {
- connectTryNum = 0;
- callback(response);
- },
- error => {
- connectTryNum = 0;
- errorCallback(error);
- },
- () => {
- connectTryNum++;
- call(method, params, callback, errorCallback);
- },
- queryTimeout
- );
+ jsonrpc.call(
+ server + path,
+ method,
+ params,
+ response => {
+ connectTryNum = 0;
+ callback(response);
+ },
+ error => {
+ connectTryNum = 0;
+ errorCallback(error);
+ },
+ () => {
+ connectTryNum++;
+ call(method, params, callback, errorCallback);
+ },
+ queryTimeout
+ );
}
const lighthouse = new Proxy(
- {},
- {
- get: function(target, name) {
- return function(...params) {
- return new Promise((resolve, reject) => {
- call(name, params, resolve, reject);
- });
- };
- }
- }
+ {},
+ {
+ get: function(target, name) {
+ return function(...params) {
+ return new Promise((resolve, reject) => {
+ call(name, params, resolve, reject);
+ });
+ };
+ },
+ }
);
export default lighthouse;
diff --git a/ui/js/page/discover/view.jsx b/ui/js/page/discover/view.jsx
index a37611cc7..22f5f2b80 100644
--- a/ui/js/page/discover/view.jsx
+++ b/ui/js/page/discover/view.jsx
@@ -5,9 +5,6 @@ import FileCard from "component/fileCard";
import { BusyMessage } from "component/common.js";
import ToolTip from "component/tooltip.js";
-
-
-
const FeaturedCategory = props => {
const { category, names } = props;
@@ -19,7 +16,9 @@ const FeaturedCategory = props => {
category.match(/^community/i) &&
}
diff --git a/ui/js/page/publish/index.js b/ui/js/page/publish/index.js
index cd01864d9..fac4419c1 100644
--- a/ui/js/page/publish/index.js
+++ b/ui/js/page/publish/index.js
@@ -15,7 +15,8 @@ const perform = dispatch => ({
back: () => dispatch(doHistoryBack()),
navigate: path => dispatch(doNavigate(path)),
fetchClaimListMine: () => dispatch(doFetchClaimListMine()),
- claimFirstChannelReward: () => dispatch(doClaimRewardType(rewards.TYPE_FIRST_CHANNEL)),
+ claimFirstChannelReward: () =>
+ dispatch(doClaimRewardType(rewards.TYPE_FIRST_CHANNEL)),
});
export default connect(select, perform)(PublishPage);
diff --git a/ui/js/page/publish/view.jsx b/ui/js/page/publish/view.jsx
index ce2cc6551..7959ad9f7 100644
--- a/ui/js/page/publish/view.jsx
+++ b/ui/js/page/publish/view.jsx
@@ -437,7 +437,8 @@ class PublishPage extends React.PureComponent {
return (
{__(
- 'A deposit of at least one credit is required to win "%s". However, you can still get a permanent URL for any amount.', this.state.name
+ 'A deposit of at least one credit is required to win "%s". However, you can still get a permanent URL for any amount.',
+ this.state.name
)}
);
@@ -445,7 +446,9 @@ class PublishPage extends React.PureComponent {
return (
{__(
- 'A deposit of at least "%s" credits is required to win "%s". However, you can still get a permanent URL for any amount.', this.state.topClaimValue, this.state.name
+ 'A deposit of at least "%s" credits is required to win "%s". However, you can still get a permanent URL for any amount.',
+ this.state.topClaimValue,
+ this.state.name
)}
);
diff --git a/ui/js/page/rewards/view.jsx b/ui/js/page/rewards/view.jsx
index bb3833006..b7342210e 100644
--- a/ui/js/page/rewards/view.jsx
+++ b/ui/js/page/rewards/view.jsx
@@ -60,7 +60,8 @@ const RewardsPage = props => {
{__("You are not eligible to claim rewards.")}
{__("To become eligible, email")}
- {" "} {__("with a link to a public social media profile.")}
+ {" "}{" "}
+ {__("with a link to a public social media profile.")}
);
diff --git a/ui/js/utils.js b/ui/js/utils.js
index 3b3160f13..783f85113 100644
--- a/ui/js/utils.js
+++ b/ui/js/utils.js
@@ -3,15 +3,15 @@
* is not set yet.
*/
export function getLocal(key, fallback = undefined) {
- const itemRaw = localStorage.getItem(key);
- return itemRaw === null ? fallback : JSON.parse(itemRaw);
+ const itemRaw = localStorage.getItem(key);
+ return itemRaw === null ? fallback : JSON.parse(itemRaw);
}
/**
* Thin wrapper around localStorage.setItem(). Converts value to JSON.
*/
export function setLocal(key, value) {
- localStorage.setItem(key, JSON.stringify(value));
+ localStorage.setItem(key, JSON.stringify(value));
}
/**
@@ -19,13 +19,13 @@ export function setLocal(key, value) {
* is not set yet.
*/
export function getSession(key, fallback = undefined) {
- const itemRaw = sessionStorage.getItem(key);
- return itemRaw === null ? fallback : JSON.parse(itemRaw);
+ const itemRaw = sessionStorage.getItem(key);
+ return itemRaw === null ? fallback : JSON.parse(itemRaw);
}
/**
* Thin wrapper around localStorage.setItem(). Converts value to JSON.
*/
export function setSession(key, value) {
- sessionStorage.setItem(key, JSON.stringify(value));
+ sessionStorage.setItem(key, JSON.stringify(value));
}