MustBeLogged component + fix sideBar auto open

This commit is contained in:
Dominic Villemure
2024-08-25 12:08:54 -04:00
parent 3796f6069d
commit 11cddfa94f
5 changed files with 56 additions and 30 deletions

View File

@@ -3,8 +3,11 @@ import { useUserStore } from "@/stores/userStore.js";
import { REACTIONS } from "@/Constants/Reactions.js";
import { computed, ref } from "vue";
import { useClient } from "@/plugins/api.js";
import {useAuthStore} from "@/stores/authStore.js"
import MustBeLogged from "@/views/MustBeLogged.vue";
const userStore = useUserStore();
const authStore = useAuthStore()
const props = defineProps({
content: {
@@ -30,9 +33,16 @@ const holdTimeout = ref(null);
const hideTimeout = ref(null);
const touchTimeout = ref(null);
const loginModal = ref(false);
initializeReactions();
async function reactToContent(reaction) {
if (!authStore.isAuthenticated) {
loginModal.value = true;
return;
}
const client = useClient();
if (!hasReacted.value) {
@@ -308,6 +318,7 @@ function isMobileDevice() {
</v-btn>
</v-card>
</v-menu>
<must-be-logged v-model="loginModal" message="Vous devez être connecté pour réagir."></must-be-logged>
</div>
</template>