toggle fix
This commit is contained in:
parent
c77a9d26d1
commit
7447155764
1 changed files with 2 additions and 4 deletions
|
@ -1,5 +1,4 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from "$app/stores";
|
|
||||||
import { db, user, userData } from "$lib/firebase";
|
import { db, user, userData } from "$lib/firebase";
|
||||||
import {
|
import {
|
||||||
arrayRemove,
|
arrayRemove,
|
||||||
|
@ -93,13 +92,12 @@
|
||||||
|
|
||||||
let publish = $userData?.published
|
let publish = $userData?.published
|
||||||
function togglePublish() {
|
function togglePublish() {
|
||||||
publish = !$userData?.published
|
publish == !publish
|
||||||
const userRef = doc(db, "users", $user!.uid);
|
const userRef = doc(db, "users", $user!.uid);
|
||||||
updateDoc(userRef, {
|
updateDoc(userRef, {
|
||||||
published: publish
|
published: publish
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
publish == $userData?.published
|
|
||||||
|
|
||||||
|
|
||||||
function moveUp(index: any) {
|
function moveUp(index: any) {
|
||||||
|
@ -235,7 +233,7 @@
|
||||||
<div class="form-control">
|
<div class="form-control">
|
||||||
<label class="label cursor-pointer">
|
<label class="label cursor-pointer">
|
||||||
<span class="label-text">Published</span>
|
<span class="label-text">Published</span>
|
||||||
<input type="checkbox" class="toggle" bind:value={publish} on:change={togglePublish}/>
|
<input type="checkbox" class="toggle" bind:checked={publish} on:change={togglePublish}/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
Loading…
Reference in a new issue