diff --git a/src/components/modals/main/scss/marketplace/_main.scss b/src/components/modals/main/scss/marketplace/_main.scss index a7e982fa..74b9824c 100644 --- a/src/components/modals/main/scss/marketplace/_main.scss +++ b/src/components/modals/main/scss/marketplace/_main.scss @@ -129,7 +129,6 @@ p.description { cursor: pointer; width: 2rem !important; height: 2rem !important; - margin-left: -8px; &:hover { color: grey; diff --git a/src/components/widgets/quote/Quote.jsx b/src/components/widgets/quote/Quote.jsx index 25bc84d6..4f5704bd 100644 --- a/src/components/widgets/quote/Quote.jsx +++ b/src/components/widgets/quote/Quote.jsx @@ -37,10 +37,20 @@ export default class Quote extends React.PureComponent { // Set the quote this.setState({ quote: '"' + quote.quote + '"', - author: quote.author + author: quote.author, + authorlink: this.getAuthorLink(quote.author) }); } + getAuthorLink(author) { + let authorlink = `https://${window.languagecode.split('_')[0]}.wikipedia.org/wiki/${author.split(' ').join('_')}`; + if (localStorage.getItem('authorLink') === 'false' || author === 'Unknown') { + authorlink = null; + } + + return authorlink; + } + async getQuote() { const offline = (localStorage.getItem('offlineMode') === 'true'); @@ -48,17 +58,21 @@ export default class Quote extends React.PureComponent { if (favouriteQuote) { return this.setState({ quote: favouriteQuote.split(' - ')[0], - author: favouriteQuote.split(' - ')[1] + author: favouriteQuote.split(' - ')[1], + authorlink: this.getAuthorLink(data.author) }); } switch (localStorage.getItem('quoteType') || 'api') { case 'custom': const customQuote = localStorage.getItem('customQuote'); + const customQuoteAuthor = localStorage.getItem('customQuoteAuthor'); + if (customQuote) { return this.setState({ quote: '"' + customQuote + '"', - author: localStorage.getItem('customQuoteAuthor'), + author: customQuoteAuthor, + authorlink: this.getAuthorLink(customQuote), type: 'custom' }); } @@ -72,9 +86,12 @@ export default class Quote extends React.PureComponent { if (quotePackAPI) { try { const data = await (await fetch(quotePackAPI.url)).json(); + const author = data[quotePackAPI.author] || quotePackAPI.author; + return this.setState({ quote: '"' + data[quotePackAPI.quote] + '"', - author: data[quotePackAPI.author] || quotePackAPI.author, + author: author, + authorlink: this.getAuthorLink(author), type: 'quote_pack' }); } catch (e) { @@ -92,6 +109,7 @@ export default class Quote extends React.PureComponent { return this.setState({ quote: '"' + data.quote + '"', author: data.author, + authorlink: this.getAuthorLink(data.author), type: 'quote_pack' }); } else { @@ -114,15 +132,12 @@ export default class Quote extends React.PureComponent { return this.doOffline(); } - let authorlink = `https://${window.languagecode.split('_')[0]}.wikipedia.org/wiki/${data.author.split(' ').join('_')}`; - if (localStorage.getItem('authorLink') === 'false' || data.author === 'Unknown') { - authorlink = null; - } + console.log(this.getAuthorLink(data.author)) this.setState({ quote: '"' + data.quote + '"', author: data.author, - authorlink: authorlink, + authorlink: this.getAuthorLink(data.author), quoteLanguage: quotelanguage, type: 'api' }); diff --git a/src/modules/helpers/marketplace.js b/src/modules/helpers/marketplace.js index 3940059d..5eabb013 100644 --- a/src/modules/helpers/marketplace.js +++ b/src/modules/helpers/marketplace.js @@ -1,5 +1,3 @@ -import { toast } from 'react-toastify'; - import EventBus from './eventbus'; export default class MarketplaceFunctions { @@ -32,12 +30,7 @@ export default class MarketplaceFunctions { EventBus.dispatch('refresh', 'marketplacebackgrounduninstall'); break; default: - try { - localStorage.removeItem(type); - } catch (e) { - toast('Failed to uninstall addon, check the console'); - console.error(e); - } + break; } let installed = JSON.parse(localStorage.getItem('installed')); @@ -64,8 +57,8 @@ export default class MarketplaceFunctions { }); localStorage.setItem('backup_settings', JSON.stringify(oldSettings)); - input.settings.forEach((element) => { - localStorage.setItem(element.name, element.value); + Object.keys(input.settings).forEach((key) => { + localStorage.setItem(key, input.settings[key]); }); break; diff --git a/src/translations/de_DE.json b/src/translations/de_DE.json index 07347dea..67c00aef 100644 --- a/src/translations/de_DE.json +++ b/src/translations/de_DE.json @@ -316,7 +316,6 @@ "photo_packs": "Fotopakete", "quote_packs": "Zitat-Pakete", "preset_settings": "Voreingestellte Einstellungen", - "themes": "Themen", "no_items": "Keine Einträge in dieser Kategorie", "product": { "overview": "Übersicht", diff --git a/src/translations/en_GB.json b/src/translations/en_GB.json index c4f9da99..488e2e08 100644 --- a/src/translations/en_GB.json +++ b/src/translations/en_GB.json @@ -316,7 +316,6 @@ "photo_packs": "Photo Packs", "quote_packs": "Quote Packs", "preset_settings": "Preset Settings", - "themes": "Themes", "no_items": "No items in this category", "product": { "overview": "Overview", diff --git a/src/translations/en_US.json b/src/translations/en_US.json index e5193327..289c5e19 100644 --- a/src/translations/en_US.json +++ b/src/translations/en_US.json @@ -316,7 +316,6 @@ "photo_packs": "Photo Packs", "quote_packs": "Quote Packs", "preset_settings": "Preset Settings", - "themes": "Themes", "no_items": "No items in this category", "product": { "overview": "Overview", diff --git a/src/translations/es.json b/src/translations/es.json index 5b43da74..ee501081 100644 --- a/src/translations/es.json +++ b/src/translations/es.json @@ -316,7 +316,6 @@ "photo_packs": "Paquetes de fotos", "quote_packs": "Paquetes de citas", "preset_settings": "Ajustes preestablecidos", - "themes": "Tema", "no_items": "No hay artículos en esta categoría", "product": { "overview": "Vista general", diff --git a/src/translations/fr.json b/src/translations/fr.json index 09a9449a..9cd771e5 100644 --- a/src/translations/fr.json +++ b/src/translations/fr.json @@ -316,7 +316,6 @@ "photo_packs": "Packs Photos", "quote_packs": "Packs Citations", "preset_settings": "Paramètres prédéfinis", - "themes": "Thèmes", "no_items": "Aucun article dans cette catégorie", "product": { "overview": "Aperçu", diff --git a/src/translations/nl.json b/src/translations/nl.json index 4c113923..e25709ae 100644 --- a/src/translations/nl.json +++ b/src/translations/nl.json @@ -316,7 +316,6 @@ "photo_packs": "Fotoverzamelingen", "quote_packs": "Citaatverzamelingen", "preset_settings": "Voorinstellingen", - "themes": "Thema's", "no_items": "No items in this category", "product": { "overview": "Overzicht", diff --git a/src/translations/no.json b/src/translations/no.json index 2df17173..561f20f2 100644 --- a/src/translations/no.json +++ b/src/translations/no.json @@ -316,7 +316,6 @@ "photo_packs": "Bilde pakker", "quote_packs": "Sitat pakker", "preset_settings": "Preset instillinger", - "themes": "Themes", "no_items": "No items in this category", "product": { "overview": "Oversikt", diff --git a/src/translations/ru.json b/src/translations/ru.json index 3cb19314..45a5bb35 100644 --- a/src/translations/ru.json +++ b/src/translations/ru.json @@ -316,7 +316,6 @@ "photo_packs": "Наборы фото", "quote_packs": "Наборы цитат", "preset_settings": "Пресеты настроек", - "themes": "Темы", "no_items": "No items in this category", "product": { "overview": "Обзор", diff --git a/src/translations/zh_CN.json b/src/translations/zh_CN.json index b63cada2..e7814df6 100644 --- a/src/translations/zh_CN.json +++ b/src/translations/zh_CN.json @@ -316,7 +316,6 @@ "photo_packs": "图片包", "quote_packs": "名言包", "preset_settings": "预设设定", - "themes": "主题", "no_items": "No items in this category", "product": { "overview": "总览",