Merge pull request #559 from liyasthomas/tweaks

chore: use typeof as an operator and make use of localizable strings
This commit is contained in:
James George
2020-02-07 15:28:31 +05:30
committed by GitHub
5 changed files with 5 additions and 4 deletions

View File

@@ -58,7 +58,7 @@ export default {
methods: { methods: {
addNewCollection() { addNewCollection() {
if (!this.$data.name) { if (!this.$data.name) {
this.$toast.info("Please provide a valid name for the collection"); this.$toast.info($t("invalid_collection_name"));
return; return;
} }
this.$store.commit("postwoman/addNewCollection", { this.$store.commit("postwoman/addNewCollection", {

View File

@@ -60,7 +60,7 @@ export default {
methods: { methods: {
saveCollection() { saveCollection() {
if (!this.$data.name) { if (!this.$data.name) {
this.$toast.info("Please provide a valid name for the collection"); this.$toast.info($t("invalid_collection_name"));
return; return;
} }
const collectionUpdated = { const collectionUpdated = {

View File

@@ -3,7 +3,7 @@ import FirefoxStrategy from "./strategies/FirefoxStrategy";
import ChromeStrategy, { hasChromeExtensionInstalled } from "./strategies/ChromeStrategy"; import ChromeStrategy, { hasChromeExtensionInstalled } from "./strategies/ChromeStrategy";
const isExtensionsAllowed = ({ state }) => { const isExtensionsAllowed = ({ state }) => {
return typeof(state.postwoman.settings.EXTENSIONS_ENABLED) === 'undefined' return typeof state.postwoman.settings.EXTENSIONS_ENABLED === 'undefined'
|| state.postwoman.settings.EXTENSIONS_ENABLED; || state.postwoman.settings.EXTENSIONS_ENABLED;
} }

View File

@@ -140,6 +140,7 @@ export default {
deleted: "Deleted", deleted: "Deleted",
undo: "Undo", undo: "Undo",
collection_empty: "Collection is empty", collection_empty: "Collection is empty",
invalid_collection_name: "Please provide a valid name for the collection",
new_collection: "New Collection", new_collection: "New Collection",
my_new_collection: "My New Collection", my_new_collection: "My New Collection",
edit_collection: "Edit Collection", edit_collection: "Edit Collection",

View File

@@ -339,7 +339,7 @@ export default {
"https://postwoman.apollotv.xyz/", "https://postwoman.apollotv.xyz/",
PROXY_KEY: this.$store.state.postwoman.settings.PROXY_KEY || "", PROXY_KEY: this.$store.state.postwoman.settings.PROXY_KEY || "",
EXTENSIONS_ENABLED: EXTENSIONS_ENABLED:
(typeof(this.$store.state.postwoman.settings.EXTENSIONS_ENABLED) !== 'undefined') ? (typeof this.$store.state.postwoman.settings.EXTENSIONS_ENABLED !== 'undefined') ?
this.$store.state.postwoman.settings.EXTENSIONS_ENABLED this.$store.state.postwoman.settings.EXTENSIONS_ENABLED
: true : true
}, },