Skip to content
Snippets Groups Projects
Commit f0105b31 authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Corrige le partage de simulation qui ne marchait plus pour le budget

parent f05245e1
No related branches found
No related tags found
No related merge requests found
Pipeline #18616 passed
<script lang="ts">
import { Dialog } from "bits-ui"
import { run } from "svelte/legacy"
import { copyToClipboard } from "$lib/clipboard"
import DialogContent from "$lib/components/DialogContent.svelte"
......@@ -21,10 +20,7 @@
let hasClickedCopy = $state(false)
let isSimulationShared
run(() => {
isSimulationShared = shared.budgetSimulation?.isPublic
})
let isSimulationShared = $derived(shared.budgetSimulation?.isPublic)
let url = $derived(
new URL(
......@@ -98,10 +94,6 @@
}
shared.budgetSimulation.isPublic = true
}
function onClose() {
isOpen = false
}
</script>
<Dialog.Root bind:open={isOpen}>
......@@ -128,11 +120,11 @@
class:cursor-pointer={!isSimulationShared}
>
<input
type="checkbox"
checked={isSimulationShared}
class="peer sr-only"
bind:checked={isSimulationShared}
onchange={onChange}
disabled={isSimulationShared}
onchange={onChange}
type="checkbox"
/>
<div
class="peer relative h-6 w-11 rounded-full border border-le-bleu bg-le-bleu-light after:absolute after:-top-[1px] after:right-[1.2rem] after:h-6 after:w-6 after:rounded-full after:border after:border-le-bleu after:bg-white after:transition-all after:content-[''] peer-checked:border-gray-200 peer-checked:bg-gray-200 peer-checked:after:translate-x-5 peer-checked:after:border-gray-200 peer-focus:outline-none"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment