fix: show warning if mail manager is missing #5
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, watch } from 'vue'
|
||||
import { useDisplay } from 'vuetify'
|
||||
import { useModuleStore } from '@KTXC/stores/moduleStore'
|
||||
import { useCollectionsStore } from '@MailManager/stores/collectionsStore'
|
||||
import { useEntitiesStore } from '@MailManager/stores/entitiesStore'
|
||||
import { useServicesStore } from '@MailManager/stores/servicesStore'
|
||||
@@ -17,6 +18,12 @@ import SettingsDialog from '@/components/settings/SettingsDialog.vue'
|
||||
// Vuetify display for responsive behavior
|
||||
const display = useDisplay()
|
||||
|
||||
// Check if mail manager is available
|
||||
const moduleStore = useModuleStore()
|
||||
const isMailManagerAvailable = computed(() => {
|
||||
return moduleStore.has('mail_manager') || moduleStore.has('MailManager')
|
||||
})
|
||||
|
||||
// Snackbar state for notifications
|
||||
const snackbarVisible = ref(false)
|
||||
const snackbarMessage = ref('')
|
||||
@@ -50,6 +57,8 @@ const isMobile = computed(() => display.mdAndDown.value)
|
||||
|
||||
// Initialize
|
||||
onMounted(async () => {
|
||||
if (!isMailManagerAvailable.value) return
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
// Load services (accounts)
|
||||
@@ -77,6 +86,8 @@ onMounted(async () => {
|
||||
watch(
|
||||
[selectedFolder, () => servicesStore.services],
|
||||
() => {
|
||||
if (!isMailManagerAvailable.value) return
|
||||
|
||||
mailSync.clearSources()
|
||||
|
||||
// Add currently selected folder to sync
|
||||
@@ -204,7 +215,28 @@ const currentMessages = computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mail-container">
|
||||
<!-- Manager Unavailable -->
|
||||
<div v-if="!isMailManagerAvailable" class="mail-unavailable">
|
||||
<v-alert
|
||||
type="warning"
|
||||
variant="outlined"
|
||||
class="mail-unavailable-alert"
|
||||
>
|
||||
<v-icon size="64" color="warning" class="mb-6">mdi-email-off-outline</v-icon>
|
||||
<h2 class="text-h5 font-weight-bold mb-4">Mail Manager Not Available</h2>
|
||||
<p>
|
||||
The Mail Manager module is not installed or enabled.
|
||||
This module requires the <strong>mail_manager</strong> module to function properly.
|
||||
</p>
|
||||
<p class="mb-0 mt-2">
|
||||
Please contact your system administrator to install and enable the
|
||||
<code>mail_manager</code> module.
|
||||
</p>
|
||||
</v-alert>
|
||||
</div>
|
||||
|
||||
<!-- Normal UI -->
|
||||
<div v-else class="mail-container">
|
||||
<!-- Top toolbar -->
|
||||
<v-app-bar class="mail-toolbar" elevation="0" density="compact">
|
||||
<v-app-bar-nav-icon
|
||||
@@ -338,6 +370,22 @@ const currentMessages = computed(() => {
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.mail-unavailable {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
padding: 48px;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mail-unavailable-alert {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.mail-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
Reference in New Issue
Block a user