Merge branch 'standalone-fix' into 'develop'
Standalone: don't memoize isStandalone See merge request soapbox-pub/soapbox-fe!703
This commit is contained in:
commit
ecdf73bbfd
|
@ -1,5 +1,129 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`<LoginPage /> renders correctly on load 1`] = `null`;
|
||||
exports[`<LoginPage /> renders correctly on load 1`] = `
|
||||
<form
|
||||
className="simple_form new_user"
|
||||
method="post"
|
||||
onSubmit={[Function]}
|
||||
>
|
||||
<fieldset
|
||||
disabled={false}
|
||||
>
|
||||
<div
|
||||
className="fields-group"
|
||||
>
|
||||
<div
|
||||
className="input email user_email"
|
||||
>
|
||||
<input
|
||||
aria-label="Username"
|
||||
autoComplete="off"
|
||||
className="string email"
|
||||
name="username"
|
||||
placeholder="Username"
|
||||
required={true}
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="input password user_password"
|
||||
>
|
||||
<input
|
||||
aria-label="Password"
|
||||
autoComplete="off"
|
||||
className="password"
|
||||
name="password"
|
||||
placeholder="Password"
|
||||
required={true}
|
||||
type="password"
|
||||
/>
|
||||
</div>
|
||||
<p
|
||||
className="hint subtle-hint"
|
||||
>
|
||||
<a
|
||||
href="/auth/reset_password"
|
||||
onClick={[Function]}
|
||||
>
|
||||
Trouble logging in?
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div
|
||||
className="actions"
|
||||
>
|
||||
<button
|
||||
className="btn button button-primary"
|
||||
name="button"
|
||||
type="submit"
|
||||
>
|
||||
Log in
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
`;
|
||||
|
||||
exports[`<LoginPage /> renders correctly on load 2`] = `null`;
|
||||
exports[`<LoginPage /> renders correctly on load 2`] = `
|
||||
<form
|
||||
className="simple_form new_user"
|
||||
method="post"
|
||||
onSubmit={[Function]}
|
||||
>
|
||||
<fieldset
|
||||
disabled={false}
|
||||
>
|
||||
<div
|
||||
className="fields-group"
|
||||
>
|
||||
<div
|
||||
className="input email user_email"
|
||||
>
|
||||
<input
|
||||
aria-label="Username"
|
||||
autoComplete="off"
|
||||
className="string email"
|
||||
name="username"
|
||||
placeholder="Username"
|
||||
required={true}
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="input password user_password"
|
||||
>
|
||||
<input
|
||||
aria-label="Password"
|
||||
autoComplete="off"
|
||||
className="password"
|
||||
name="password"
|
||||
placeholder="Password"
|
||||
required={true}
|
||||
type="password"
|
||||
/>
|
||||
</div>
|
||||
<p
|
||||
className="hint subtle-hint"
|
||||
>
|
||||
<a
|
||||
href="/auth/reset_password"
|
||||
onClick={[Function]}
|
||||
>
|
||||
Trouble logging in?
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div
|
||||
className="actions"
|
||||
>
|
||||
<button
|
||||
className="btn button button-primary"
|
||||
name="button"
|
||||
type="submit"
|
||||
>
|
||||
Log in
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
`;
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
*/
|
||||
|
||||
import { getSoapboxConfig } from'soapbox/actions/soapbox';
|
||||
import { createSelector } from 'reselect';
|
||||
import { isPrerendered } from 'soapbox/precheck';
|
||||
import { isURL } from 'soapbox/utils/auth';
|
||||
import { BACKEND_URL } from 'soapbox/build_config';
|
||||
|
@ -24,8 +23,7 @@ export const federationRestrictionsDisclosed = state => {
|
|||
* @param {object} state
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export const isStandalone = state => createSelector([
|
||||
state => state.getIn(['meta', 'instance_fetch_failed'], false),
|
||||
], instanceFetchFailed => {
|
||||
export const isStandalone = state => {
|
||||
const instanceFetchFailed = state.getIn(['meta', 'instance_fetch_failed'], false);
|
||||
return isURL(BACKEND_URL) ? false : (!isPrerendered && instanceFetchFailed);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue