diff --git a/src/features/background/components/PhotoInformation.jsx b/src/features/background/components/PhotoInformation.jsx index e49d6075..4a856170 100644 --- a/src/features/background/components/PhotoInformation.jsx +++ b/src/features/background/components/PhotoInformation.jsx @@ -227,7 +227,7 @@ function PhotoInformation({ info, url, api }) { downloadImage(info)} /> )} - {info.pun && ( + {(info.pun && info.category) && ( : null} - {showExtraInfo || other ? ( + {(showExtraInfo || other) && excludeModal === false ? ( <> {variables.getMessage('widgets.background.information')} diff --git a/src/features/marketplace/views/Browse.jsx b/src/features/marketplace/views/Browse.jsx index cdecd1ac..85df837c 100644 --- a/src/features/marketplace/views/Browse.jsx +++ b/src/features/marketplace/views/Browse.jsx @@ -135,6 +135,9 @@ class Marketplace extends PureComponent { } async getItems() { + this.setState({ + done: false, + }); const dataURL = this.props.type === 'collections' ? variables.constants.API_URL + '/marketplace/collections' diff --git a/src/features/welcome/Welcome.jsx b/src/features/welcome/Welcome.jsx index 14799684..2d0f107a 100644 --- a/src/features/welcome/Welcome.jsx +++ b/src/features/welcome/Welcome.jsx @@ -26,6 +26,7 @@ function WelcomeModal({ modalClose, modalSkip }) { // State variables const [currentTab, setCurrentTab] = useState(0); const [buttonText, setButtonText] = useState(variables.getMessage('modals.welcome.buttons.next')); + const [importedSettings, setImportedSettings] = useState([]); const finalTab = 6; // useEffect hook to handle tab changes and event bus listener @@ -125,11 +126,13 @@ function WelcomeModal({ modalClose, modalSkip }) { const tabComponents = { 0: , 1: , - 2: , + 2: , 3: , 4: , 5: , - 6: , + 6: ( + + ), }; // Current tab component diff --git a/src/features/welcome/components/Sections/Final.jsx b/src/features/welcome/components/Sections/Final.jsx index 8689a067..fe8a738b 100644 --- a/src/features/welcome/components/Sections/Final.jsx +++ b/src/features/welcome/components/Sections/Final.jsx @@ -28,15 +28,14 @@ function Final(props) { )} - {/*} - {this.state.importedSettings.length !== 0 && ( -
this.props.switchTab(2)}> - {variables.getMessage('modals.main.settings.sections.final.imported', { - amount: this.state.importedSettings.length, + {props.importedSettings.length !== 0 && ( +
props.switchTab(3)}> + {variables.getMessage('modals.main.welcome.sections.final.imported', { + amount: props.importedSettings.length, })}{' '} - {this.state.importedSettings.length} + {props.importedSettings.length}
- )}*/} + )}
); diff --git a/src/features/welcome/components/Sections/ImportSettings.jsx b/src/features/welcome/components/Sections/ImportSettings.jsx index 23cd3c8a..44305ce3 100644 --- a/src/features/welcome/components/Sections/ImportSettings.jsx +++ b/src/features/welcome/components/Sections/ImportSettings.jsx @@ -1,5 +1,4 @@ import variables from 'config/variables'; -import { useState } from 'react'; import { FileUpload } from 'components/Form/Settings'; import { MdCloudUpload } from 'react-icons/md'; import { importSettings as importSettingsFunction } from 'utils/settings'; @@ -7,13 +6,11 @@ import { Header, Content } from '../Layout'; import default_settings from 'utils/data/default_settings.json'; function ImportSettings(props) { - const [importedSettings, setImportedSettings] = useState([]); - const importSettings = (e) => { importSettingsFunction(e); const settings = []; - const data = JSON.parse(e.target.result); + const data = JSON.parse(e); Object.keys(data).forEach((setting) => { // language and theme already shown, the others are only used internally if ( @@ -39,8 +36,8 @@ function ImportSettings(props) { }); }); - setImportedSettings(settings); - props.switchTab(5); + props.setImportedSettings(settings); + props.switchTab(6); }; return (