fix: various fixes and remove unused code

This commit is contained in:
David Ralph
2022-09-11 22:01:06 +01:00
parent ba9bab2b4d
commit 2c760038e0
6 changed files with 22 additions and 55 deletions

View File

@@ -40,5 +40,5 @@
}
.micActive {
box-shadow: 0px 0px 50px 9px #e74c3c !important;
box-shadow: 0px 0px 50px 1px #e74c3c !important;
}

View File

@@ -68,10 +68,12 @@ export default class BackgroundSettings extends PureComponent {
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'}
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')}
@@ -80,9 +82,7 @@ export default class BackgroundSettings extends PureComponent {
value2={Date.now()}
>
<option value="refresh">{variables.getMessage('tabname')}</option>
<option value="10000">
10 secs
</option>
<option value="10000">10 secs</option>
<option value="60000">
{variables.getMessage('modals.main.settings.sections.background.interval.minute')}
</option>
@@ -433,9 +433,11 @@ export default class BackgroundSettings extends PureComponent {
</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}
{this.state.backgroundType === 'api' ||
this.state.backgroundType === 'custom' ||
this.state.marketplaceEnabled
? interval
: null}
{backgroundSettings}
</>
) : null}

View File

@@ -27,7 +27,10 @@ export default class Maximise extends PureComponent {
let backgroundFilter;
if (filter === true) {
backgroundFilter = localStorage.getItem('backgroundFilter');
const filterData = localStorage.getItem('backgroundFilter');
if (filterData !== 'none') {
backgroundFilter = filterData;
}
}
element.setAttribute(

View File

@@ -17,7 +17,6 @@ import ShareModal from '../../helpers/sharemodal/ShareModal';
import offline_quotes from './offline_quotes.json';
import Interval from 'modules/helpers/interval';
import EventBus from 'modules/helpers/eventbus';
import './quote.scss';

View File

@@ -1,6 +1,6 @@
import variables from 'modules/variables';
import { PureComponent, createRef } from 'react';
import { MdSearch, MdMic, MdSettings } from 'react-icons/md';
import { MdSearch, MdMic, MdScreenSearchDesktop } from 'react-icons/md';
import Tooltip from 'components/helpers/tooltip/Tooltip';
import AutocompleteInput from 'components/helpers/autocomplete/Autocomplete';
@@ -133,15 +133,9 @@ export default class Search extends PureComponent {
}
toggleDropdown() {
if (this.state.searchDropdown === 'hidden') {
this.setState({
searchDropdown: 'visible',
});
} else {
this.setState({
searchDropdown: 'hidden',
});
}
this.setState({
searchDropdown: (this.state.searchDropdown === 'hidden') ? 'visible' : 'hidden',
});
}
setSearch(name, custom) {
@@ -201,7 +195,7 @@ export default class Search extends PureComponent {
{localStorage.getItem('searchDropdown') === 'true' ? (
<Tooltip title={variables.getMessage('widgets.search')}>
<button>
<MdSettings onClick={() => this.toggleDropdown()} />
<MdScreenSearchDesktop onClick={() => this.toggleDropdown()} />
</button>
</Tooltip>
) : (