diff --git a/src/components/modals/main/marketplace/Items.jsx b/src/components/modals/main/marketplace/Items.jsx index 3fe6819c..fa40ca41 100644 --- a/src/components/modals/main/marketplace/Items.jsx +++ b/src/components/modals/main/marketplace/Items.jsx @@ -49,7 +49,7 @@ export default function Items({ {getMessage('modals.main.marketplace.cant_find')} {getMessage('modals.main.marketplace.knowledgebase_one')}{' '} - + {getMessage('modals.main.marketplace.knowledgebase_two')} {' '} {getMessage('modals.main.marketplace.knowledgebase_three')} diff --git a/src/components/modals/main/marketplace/sections/Sideload.jsx b/src/components/modals/main/marketplace/sections/Sideload.jsx index 79d04230..9478d145 100644 --- a/src/components/modals/main/marketplace/sections/Sideload.jsx +++ b/src/components/modals/main/marketplace/sections/Sideload.jsx @@ -68,7 +68,7 @@ export default class Sideload extends PureComponent { id="file-input" type="settings" accept="application/json" - loadFunction={(e) => this.installAddon(JSON.parse(e.target.result))} + loadFunction={(e) => this.installAddon(JSON.parse(e))} /> {this.getMessage('modals.main.addons.sideload.title')} diff --git a/src/components/modals/main/settings/FileUpload.jsx b/src/components/modals/main/settings/FileUpload.jsx index 69231734..13eeef28 100644 --- a/src/components/modals/main/settings/FileUpload.jsx +++ b/src/components/modals/main/settings/FileUpload.jsx @@ -14,6 +14,7 @@ export default class FileUpload extends PureComponent { if (this.props.type === 'settings') { reader.readAsText(file, 'UTF-8'); + return this.props.loadFunction(e); } else { // background upload const settings = {}; diff --git a/src/components/modals/main/settings/sections/Changelog.jsx b/src/components/modals/main/settings/sections/Changelog.jsx index 18297427..7f2800b9 100644 --- a/src/components/modals/main/settings/sections/Changelog.jsx +++ b/src/components/modals/main/settings/sections/Changelog.jsx @@ -19,16 +19,20 @@ export default class Changelog extends PureComponent { } async getUpdate() { - const data = await ( - await fetch(variables.constants.BLOG_POST + '/index.json', { - signal: this.controller.signal, - }) - ).json(); + const res = await fetch(variables.constants.BLOG_POST + '/index.json', { + signal: this.controller.signal, + }); + + if (res.status === 404) { + this.setState({ error: true }); + return; + } if (this.controller.signal.aborted === true) { return; } + const data = await res.json(); let date = new Date(data.date.split(' ')[0]); date = date.toLocaleDateString(variables.languagecode.replace('_', '-'), { year: 'numeric', @@ -105,6 +109,16 @@ export default class Changelog extends PureComponent { ); } + if (this.state.error === true) { + return errorMessage( + <> + + failed + error description + >, + ); + } + if (!this.state.title) { return errorMessage( diff --git a/src/components/modals/main/settings/sections/Quote.jsx b/src/components/modals/main/settings/sections/Quote.jsx index 07ed4a21..402b4cba 100644 --- a/src/components/modals/main/settings/sections/Quote.jsx +++ b/src/components/modals/main/settings/sections/Quote.jsx @@ -221,8 +221,8 @@ export default class QuoteSettings extends PureComponent { /> - this.setState({ customValue: e.target.value })} - varient="outlined" - InputLabelProps={{ shrink: true }} - /> + + this.setState({ customValue: e.target.value })} + varient="outlined" + InputLabelProps={{ shrink: true }} + /> + {this.state.backgroundCategories[0] === getMessage('modals.main.loading') ? ( <> @@ -206,7 +207,7 @@ export default class BackgroundSettings extends PureComponent { if (this.state.effects === true) { header = ( this.setState({ effects: false })}> - {getMessage('modals.main.settings.sections.background.title')}{' '} + {getMessage('modals.main.settings.sections.background.title')} {' '} {getMessage('modals.main.settings.sections.background.effects.title')} @@ -232,6 +233,7 @@ export default class BackgroundSettings extends PureComponent { /> ); } + return ( <> {header} @@ -282,7 +284,9 @@ export default class BackgroundSettings extends PureComponent { - this.setState({ effects: true })}> + {(this.state.backgroundType === 'api' || + this.state.backgroundType === 'custom' || + this.state.marketplaceEnabled) ? <> this.setState({ effects: true })}> @@ -298,10 +302,12 @@ export default class BackgroundSettings extends PureComponent { {' '} - + > : null} > ) : null} - {this.state.backgroundSettingsSection !== true && this.state.effects !== true ? ( + {this.state.backgroundSettingsSection !== true && this.state.effects !== true && (this.state.backgroundType === 'api' || + this.state.backgroundType === 'custom' || + this.state.marketplaceEnabled) ? ( this.resetColour()}> {this.getMessage('modals.main.settings.buttons.reset')} diff --git a/src/modules/constants.js b/src/modules/constants.js index 955ce2eb..933d5289 100644 --- a/src/modules/constants.js +++ b/src/modules/constants.js @@ -20,7 +20,7 @@ export const BUG_REPORT = export const DONATE_LINK = 'https://muetab.com/donate'; export const SENTRY_DSN = 'https://430352fd4b174d688ebd82fc85c22c58@o1217438.ingest.sentry.io/6359480'; -export const KNOWLEDGEBASE = 'https://knowledgebase.muetab.com'; +export const KNOWLEDGEBASE = 'https://support.muetab.com'; // Mue Info export const ORG_NAME = 'mue'; diff --git a/src/modules/helpers/marketplace.js b/src/modules/helpers/marketplace.js index 5c7da7e8..9abbfb1a 100644 --- a/src/modules/helpers/marketplace.js +++ b/src/modules/helpers/marketplace.js @@ -9,7 +9,7 @@ function showReminder() { export function urlParser(input) { const urlPattern = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_+.~#?&//=]*)/; - return input.replace(urlPattern, '$&'); + return input.replace(urlPattern, '$&'); } export function install(type, input, sideload) { diff --git a/src/translations/en_GB.json b/src/translations/en_GB.json index 4681d7be..fa8ad431 100644 --- a/src/translations/en_GB.json +++ b/src/translations/en_GB.json @@ -146,6 +146,7 @@ "custom_author": "Custom author", "author_img": "Show author image", "add": "Add quote", + "source_subtitle": "Choose where to get quotes from", "buttons": { "title": "Buttons", "subtitle": "Choose which buttons to show on the quote",
error description