fix: various

- temporarily comment out quote interval
- fix background transition on firefox
This commit is contained in:
alexsparkes
2022-11-15 20:12:18 +00:00
parent b18113d468
commit 146c74e0cb
3 changed files with 30 additions and 25 deletions

View File

@@ -137,13 +137,13 @@ export default class BackgroundSettings extends PureComponent {
{category.count})
</MenuItem>
))}
</Dropdown>
</Dropdown>*/}
<ChipSelect
label={variables.getMessage('modals.main.settings.sections.background.category')}
options={this.state.backgroundCategories}
name="apiCategories"
></ChipSelect>
*/}
</>
)}
<Dropdown

View File

@@ -12,7 +12,9 @@
.backgroundTransform {
@include animation('fadein2 2s');
transition: background 2s;
-webkit-transition: background 2s;
-o-transition: background 2s;
transition: background 2s;
}
@include keyframes(fadein2) {

View File

@@ -329,29 +329,32 @@ export default class Quote extends PureComponent {
}
componentDidMount() {
const test = localStorage.getItem('quotechange');
// const test = localStorage.getItem('quotechange');
this.interval = setInterval(() => {
if (test !== null) {
const targetTime = Number(
Number(localStorage.getItem('quoteStartTime')) +
Number(localStorage.getItem('quotechange')),
);
const currentTime = Number(Date.now());
if (currentTime >= targetTime) {
this.setZoom();
this.getQuote();
localStorage.setItem('quoteStartTime', Date.now());
} else {
try {
this.setState(JSON.parse(localStorage.getItem('currentQuote')));
} catch (e) {
this.setZoom();
this.getQuote();
}
}
}
});
// this.interval = setInterval(() => {
// if (test !== null) {
// const targetTime = Number(
// Number(localStorage.getItem('quoteStartTime')) +
// Number(localStorage.getItem('quotechange')),
// );
// const currentTime = Number(Date.now());
// if (currentTime >= targetTime) {
// this.setZoom();
// this.getQuote();
// localStorage.setItem('quoteStartTime', Date.now());
// } else {
// try {
// this.setState(JSON.parse(localStorage.getItem('currentQuote')));
// } catch (e) {
// this.setZoom();
// this.getQuote();
// }
// }
// }
// });
this.setZoom();
this.getQuote();
EventBus.on('refresh', (data) => {
if (data === 'quote') {