diff --git a/src/components/helpers/autocomplete/Autocomplete.jsx b/src/components/helpers/autocomplete/Autocomplete.jsx index 1718a3b6..cf1a6457 100644 --- a/src/components/helpers/autocomplete/Autocomplete.jsx +++ b/src/components/helpers/autocomplete/Autocomplete.jsx @@ -1,5 +1,7 @@ import { PureComponent } from 'react'; +import EventBus from '../../../modules/helpers/eventbus'; + import './autocomplete.scss'; export default class Autocomplete extends PureComponent { @@ -7,12 +9,13 @@ export default class Autocomplete extends PureComponent { super(props); this.state = { filtered: [], - input: '' + input: '', + autocompleteDisabled: (localStorage.getItem('autocomplete') !== 'true') }; } onChange = (e) => { - if (localStorage.getItem('autocomplete') !== 'true') { + if (this.state.autocompleteDisabled) { return this.setState({ input: e.target.value }); @@ -35,6 +38,16 @@ export default class Autocomplete extends PureComponent { this.props.onClick(e); }; + componentDidMount() { + EventBus.on('refresh', (data) => { + if (data === 'search') { + this.setState({ + autocompleteDisabled: (localStorage.getItem('autocomplete') !== 'true') + }); + } + }); + } + render() { let autocomplete = null; diff --git a/src/components/modals/main/settings/sections/Appearance.jsx b/src/components/modals/main/settings/sections/Appearance.jsx index 7709c937..2153d6bc 100644 --- a/src/components/modals/main/settings/sections/Appearance.jsx +++ b/src/components/modals/main/settings/sections/Appearance.jsx @@ -55,6 +55,7 @@ export default function AppearanceSettings() {

{appearance.accessibility.title}

+ {/* not supported on firefox */} {(navigator.userAgent.includes('Chrome') && typeof InstallTrigger === 'undefined') ? : null} diff --git a/src/components/modals/main/settings/sections/Greeting.jsx b/src/components/modals/main/settings/sections/Greeting.jsx index 07aa8bb3..ef550746 100644 --- a/src/components/modals/main/settings/sections/Greeting.jsx +++ b/src/components/modals/main/settings/sections/Greeting.jsx @@ -29,14 +29,14 @@ export default class GreetingSettings extends PureComponent { <>

{greeting.title}

- - - - + + + +

{greeting.birthday}

- - + +

{greeting.birthday_date}

diff --git a/src/components/modals/main/settings/sections/Language.jsx b/src/components/modals/main/settings/sections/Language.jsx index 335e643b..e9ee2d59 100644 --- a/src/components/modals/main/settings/sections/Language.jsx +++ b/src/components/modals/main/settings/sections/Language.jsx @@ -60,7 +60,7 @@ export default class BackgroundSettings extends PureComponent { return ( <>

{language.title}

- +

{language.quote}

diff --git a/src/components/modals/main/settings/sections/QuickLinks.jsx b/src/components/modals/main/settings/sections/QuickLinks.jsx index 95747acd..22cee2fd 100644 --- a/src/components/modals/main/settings/sections/QuickLinks.jsx +++ b/src/components/modals/main/settings/sections/QuickLinks.jsx @@ -8,11 +8,11 @@ export default function QuickLinks() { return ( <>

{language.title}

- - - - - + + + + + ); } diff --git a/src/components/modals/main/settings/sections/Quote.jsx b/src/components/modals/main/settings/sections/Quote.jsx index 3e6d6e3a..4aaf95df 100644 --- a/src/components/modals/main/settings/sections/Quote.jsx +++ b/src/components/modals/main/settings/sections/Quote.jsx @@ -27,8 +27,8 @@ export default class QuoteSettings extends PureComponent { if (this.state.quoteType === 'custom') { customSettings = ( <> - - + + ); } else { @@ -60,7 +60,7 @@ export default class QuoteSettings extends PureComponent { {customSettings} - +

{quote.buttons.title}

diff --git a/src/components/modals/main/settings/sections/Search.jsx b/src/components/modals/main/settings/sections/Search.jsx index c190fbe5..335b5e4d 100644 --- a/src/components/modals/main/settings/sections/Search.jsx +++ b/src/components/modals/main/settings/sections/Search.jsx @@ -89,7 +89,7 @@ export default class SearchSettings extends PureComponent { this.setState({ customValue: e.target.value })}>
- + ); diff --git a/src/components/modals/main/settings/sections/Time.jsx b/src/components/modals/main/settings/sections/Time.jsx index 3bc8e873..b123f4af 100644 --- a/src/components/modals/main/settings/sections/Time.jsx +++ b/src/components/modals/main/settings/sections/Time.jsx @@ -35,21 +35,21 @@ export default class TimeSettings extends PureComponent { const digitalSettings = ( <>

{time.digital.title}

- +
- - + + ); const analogSettings = ( <>

{time.analogue.title}

- - - - - + + + + + ); @@ -63,21 +63,21 @@ export default class TimeSettings extends PureComponent { const longSettings = ( <> - - + + ); const shortSettings = ( <>
- +

- + @@ -96,27 +96,27 @@ export default class TimeSettings extends PureComponent { <>

{time.title}

- this.setState({ timeType: value })} category='clock' element='.clock-container'> + this.setState({ timeType: value })} category='clock'> {timeSettings} {this.state.timeType !== 'analogue' ? - + : null}

{time.date.title}

- this.setState({ dateType: value })} category='date' element='.date'> + this.setState({ dateType: value })} category='date'>
- - + + {dateSettings} - + ); } diff --git a/src/components/modals/main/settings/sections/background/Background.jsx b/src/components/modals/main/settings/sections/background/Background.jsx index 257af71e..a584fef8 100644 --- a/src/components/modals/main/settings/sections/background/Background.jsx +++ b/src/components/modals/main/settings/sections/background/Background.jsx @@ -121,7 +121,7 @@ export default class BackgroundSettings extends PureComponent { ))}


- + @@ -166,9 +166,9 @@ export default class BackgroundSettings extends PureComponent { <>

{background.title}

- - - + + +

{background.source.title}

this.setState({ backgroundType: value })} category='background'> diff --git a/src/components/widgets/quote/Quote.jsx b/src/components/widgets/quote/Quote.jsx index b6e12cbc..0f051065 100644 --- a/src/components/widgets/quote/Quote.jsx +++ b/src/components/widgets/quote/Quote.jsx @@ -211,6 +211,13 @@ export default class Quote extends PureComponent { element.style.display = 'block'; this.init(); + + // buttons hot reload + this.setState({ + favourited: this.useFavourite(), + tweet: (localStorage.getItem('tweetButton') === 'false') ? null : this.buttons.tweet, + copy: (localStorage.getItem('copyButton') === 'false') ? null : this.buttons.copy + }); } // uninstall quote pack reverts the quote to what you had previously