MustBeLogged component + fix sideBar auto open
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user