lora-studio / src /lib /components /UserIsLogged.svelte
enzostvs's picture
enzostvs HF staff
fix click on reaction stopPropagation and already_saved is stored now
3d344de
raw
history blame
625 Bytes
<script lang="ts">
import { get } from "svelte/store";
import { loginModalStore } from "$lib/stores/use-login-modal";
import { userStore } from "$lib/stores/use-user";
let user = get(userStore);
const handleClick = (e: any) => {
e.preventDefault();
e.stopPropagation();
if (!user) {
loginModalStore.update(() => true);
}
};
</script>
<!-- svelte-ignore a11y-no-static-element-interactions -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="w-full cursor-pointer block"
on:click={handleClick}
>
<div class:pointer-events-none={!user}>
<slot />
</div>
</div>