Skip to content

Commit

Permalink
fix(dashboard): plugin theme setter
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Jan 30, 2022
1 parent afed7b6 commit e0c884b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<h1 class="text-xl font-poppins font-bold wb-text">
{{ t('dashboard.title') }}
</h1>
<HeroIcon class="wb-icon" @click.prevent.stop="router.push('/')">
<HeroIcon
v-if="local.getProject()"
class="wb-icon"
@click.prevent.stop="router.push('/')"
>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
Expand All @@ -25,9 +29,12 @@
</template>

<script setup lang="ts">
import { useLocalStorage } from '@/use/storage/local'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
const { t } = useI18n()
const router = useRouter()
const local = useLocalStorage()
</script>
8 changes: 8 additions & 0 deletions packages/better-write-app/src/pages/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

<script setup lang="ts">
import { useAuthStore } from '@/store/auth'
import { tryOnMounted } from '@vueuse/core'
import { usePlugin } from 'better-write-plugin-core'
const AUTH = useAuthStore()
const plugin = usePlugin()
tryOnMounted(() => {
plugin.emit('plugin-theme-set')
})
</script>

0 comments on commit e0c884b

Please sign in to comment.