Skip to content

Commit

Permalink
Display store name in title page
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNaif2018 committed Nov 1, 2022
1 parent 293db81 commit 03b7567
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ export function copyToClipboard(text) {
document.body.removeChild(el)
}

export function isEmpty(obj) {
return Object.entries(obj).length === 0 && obj.constructor === Object
}

export default {
slug,
decimalStr,
copyToClipboard,
isEmpty,
}
7 changes: 6 additions & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import Header from "@/components/Header"
import VERSION from "@/version"
import CartSidebar from "@/components/CartSidebar"
import { isEmpty } from "@/helpers"
export default {
components: {
Expand All @@ -30,6 +31,9 @@ export default {
},
head() {
const themeURL = this.$store.state.store?.theme_settings?.store_theme_url
const commonHead = !isEmpty(this.$store.state.store)
? { title: `${this.$store.state.store.name} | bitcart-store` }
: {}
return themeURL
? {
link: [
Expand All @@ -38,8 +42,9 @@ export default {
href: themeURL,
},
],
...commonHead,
}
: {}
: commonHead
},
beforeCreate() {
this.$store.dispatch("syncStats")
Expand Down

0 comments on commit 03b7567

Please sign in to comment.