Only show attach button if user is admin
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 2m4s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 2m4s
This commit is contained in:
@@ -2,9 +2,11 @@
|
|||||||
import { ref, computed, watch, nextTick, onMounted, onUnmounted } from "vue";
|
import { ref, computed, watch, nextTick, onMounted, onUnmounted } from "vue";
|
||||||
import Button from "@/components/input/Button.vue";
|
import Button from "@/components/input/Button.vue";
|
||||||
import { useMessagesStore } from "@/stores/messages";
|
import { useMessagesStore } from "@/stores/messages";
|
||||||
|
import { useAuthStore } from "@/stores/auth";
|
||||||
import Header from "@/components/text/Header.vue";
|
import Header from "@/components/text/Header.vue";
|
||||||
|
|
||||||
const messagesStore = useMessagesStore();
|
const messagesStore = useMessagesStore();
|
||||||
|
const authStore = useAuthStore();
|
||||||
const messages = computed(() => messagesStore.messages);
|
const messages = computed(() => messagesStore.messages);
|
||||||
const messageInput = ref("");
|
const messageInput = ref("");
|
||||||
const messagesContainer = ref(null);
|
const messagesContainer = ref(null);
|
||||||
@@ -80,7 +82,7 @@ onUnmounted(() => {
|
|||||||
@change="onFileSelected" />
|
@change="onFileSelected" />
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<Button @click="sendMessage">Send</Button>
|
<Button @click="sendMessage">Send</Button>
|
||||||
<Button @click="fileInput.click()">Attach</Button>
|
<Button v-if="authStore.user.admin" @click="fileInput.click()">Attach</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user