From 96f26042d29dc7ce86c4829dc181f8a97c9f5461 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Sun, 19 Sep 2021 11:22:53 +0100 Subject: [PATCH] fix: toast duration setting, create quote pack section --- .../main/marketplace/sections/Create.jsx | 53 +++++++++++-------- .../main/settings/sections/Appearance.jsx | 2 +- src/translations/de_DE.json | 11 +++- src/translations/en_GB.json | 11 +++- src/translations/en_US.json | 11 +++- src/translations/es.json | 11 +++- src/translations/fr.json | 11 +++- src/translations/nl.json | 11 +++- src/translations/no.json | 11 +++- src/translations/ru.json | 11 +++- src/translations/zh_CN.json | 11 +++- 11 files changed, 123 insertions(+), 31 deletions(-) diff --git a/src/components/modals/main/marketplace/sections/Create.jsx b/src/components/modals/main/marketplace/sections/Create.jsx index 66de88d5..60d24ebc 100644 --- a/src/components/modals/main/marketplace/sections/Create.jsx +++ b/src/components/modals/main/marketplace/sections/Create.jsx @@ -1,4 +1,3 @@ -/* eslint-disable no-unused-vars */ import variables from 'modules/variables'; import { PureComponent } from 'react'; import { @@ -70,14 +69,20 @@ export default class Create extends PureComponent { } }); - toast('Imported settings!'); + toast(variables.getMessage(variables.languagecode, 'toasts.imported')); } - updateQuotePackType(e) { - if (e === 'quotePack') { + updateQuotePackType(type) { + if (type === 'quotePack') { this.setState({ addonMetadata: { - type: e, + type, + name: this.state.addonMetadata.name, + description: this.state.addonMetadata.description, + version: this.state.addonMetadata.version, + author: this.state.addonMetadata.author, + icon_url: this.state.addonMetadata.icon_url, + screenshot_url: this.state.addonMetadata.screenshot_url, quotes: [{ quote: '', author: '' @@ -87,12 +92,18 @@ export default class Create extends PureComponent { } else { this.setState({ addonMetadata: { - type: e, - quote_api: { - url: '', - name: '', - author: '' - } + type, + name: this.state.addonMetadata.name, + description: this.state.addonMetadata.description, + version: this.state.addonMetadata.version, + author: this.state.addonMetadata.author, + icon_url: this.state.addonMetadata.icon_url, + screenshot_url: this.state.addonMetadata.screenshot_url + }, + addonData: { + url: '', + name: '', + author: '' } }); } @@ -187,7 +198,7 @@ export default class Create extends PureComponent {