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: {
addNewCollection() {
if (!this.$data.name) {
this.$toast.info("Please provide a valid name for the collection");
this.$toast.info($t("invalid_collection_name"));
return;
}
this.$store.commit("postwoman/addNewCollection", {

View File

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

View File

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

View File

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

View File

@@ -339,7 +339,7 @@ export default {
"https://postwoman.apollotv.xyz/",
PROXY_KEY: this.$store.state.postwoman.settings.PROXY_KEY || "",
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
: true
},