Fix warnings
This commit is contained in:
parent
65048063aa
commit
39a2626c3a
5 changed files with 15 additions and 49 deletions
|
|
@ -51,7 +51,7 @@
|
|||
<SurveyBadge class="ms-2" {survey} />
|
||||
</div>
|
||||
|
||||
{#if $user.is_admin && edit}
|
||||
{#if $user && $user.is_admin && edit}
|
||||
<SurveyAdmin {survey} on:saved={() => edit = false} />
|
||||
{/if}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
<script lang="ts">
|
||||
<script>
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
import { user } from '../../stores/user';
|
||||
import SurveyAdmin from '../../components/SurveyAdmin.svelte';
|
||||
import SurveyBadge from '../../components/SurveyBadge.svelte';
|
||||
import SurveyQuestions from '../../components/SurveyQuestions.svelte';
|
||||
import { Survey } from '../../lib/surveys';
|
||||
import { getQuestions } from '../../lib/questions';
|
||||
|
||||
let survey = new Survey();
|
||||
</script>
|
||||
|
|
@ -19,6 +17,6 @@
|
|||
<SurveyBadge class="ms-2" {survey} />
|
||||
</div>
|
||||
|
||||
{#if $user.is_admin}
|
||||
{#if $user && $user.is_admin}
|
||||
<SurveyAdmin {survey} on:saved={(e) => { goto(`surveys/${e.detail.id}`)}} />
|
||||
{/if}
|
||||
|
|
|
|||
Reference in a new issue