fix: interval not appearing for marketplace

This commit is contained in:
David Ralph
2022-09-11 17:54:07 +01:00
parent 6cbc677183
commit ba9bab2b4d
2 changed files with 9 additions and 5 deletions

View File

@@ -62,14 +62,16 @@ export default class BackgroundSettings extends PureComponent {
}
render() {
const { getMessage } = this;
const interval = (
<SettingsItem
title={variables.getMessage('modals.main.settings.sections.background.interval.title')}
subtitle={variables.getMessage(
'modals.mani.settings.sections.background.intervanl.subtitle',
)}
final={localStorage.getItem('photo_packs') &&
this.state.backgroundType !== 'custom' &&
this.state.backgroundType !== 'colour' &&
this.state.backgroundType !== 'api'}
>
<Dropdown
label={variables.getMessage('modals.main.settings.sections.background.interval.title')}
@@ -103,7 +105,6 @@ export default class BackgroundSettings extends PureComponent {
const APISettings = (
<>
{interval}
<SettingsItem
title={variables.getMessage('modals.main.settings.sections.background.api')}
subtitle={variables.getMessage('modals.main.settings.sections.background.api_subtitle')}
@@ -189,7 +190,7 @@ export default class BackgroundSettings extends PureComponent {
let backgroundSettings = APISettings;
switch (this.state.backgroundType) {
case 'custom':
backgroundSettings = <CustomSettings interval={interval} />;
backgroundSettings = <CustomSettings />;
break;
case 'colour':
backgroundSettings = <ColourSettings />;
@@ -431,6 +432,10 @@ export default class BackgroundSettings extends PureComponent {
</option>
</Dropdown>
</SettingsItem>
{/* // todo: ideally refactor all of this file, but we need interval to appear on marketplace too */}
{(this.state.backgroundType === 'api' ||
this.state.backgroundType === 'custom' ||
this.state.marketplaceEnabled) ? interval : null}
{backgroundSettings}
</>
) : null}

View File

@@ -175,7 +175,6 @@ export default class CustomSettings extends PureComponent {
render() {
return (
<>
{this.props.interval}
<div className="dropzone" ref={this.customDnd}>
<div className="imagesTopBar">
<div>