Fix reactivity bug
This commit is contained in:
parent
ae09d9a1ef
commit
2d280d9ff8
|
|
@ -42,10 +42,11 @@
|
|||
|
||||
<p
|
||||
class="assignment__feedback"
|
||||
v-if="assignment.submission.submissionFeedback"
|
||||
v-if="assignment.submission?.submissionFeedback"
|
||||
v-html="feedbackText"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-if="!isStudent && assignment.id">
|
||||
<router-link
|
||||
:to="{ name: 'submissions', params: { id: assignment.id } }"
|
||||
|
|
@ -58,7 +59,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineAsyncComponent, nextTick, onMounted, reactive, ref, watch } from 'vue';
|
||||
import { defineAsyncComponent, nextTick, onMounted, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useMutation, useQuery } from '@vue/apollo-composable';
|
||||
import { graphql } from '@/__generated__';
|
||||
|
|
@ -91,7 +92,7 @@ const initialSubmission = {
|
|||
document: '',
|
||||
final: false,
|
||||
};
|
||||
const assignment = reactive({ submission: initialSubmission });
|
||||
const assignment = ref({ submission: initialSubmission });
|
||||
const corrections = ref('');
|
||||
const unsaved = ref(false);
|
||||
const saving = ref(0);
|
||||
|
|
@ -264,9 +265,12 @@ const unmark = () => {
|
|||
|
||||
onResult(async () => {
|
||||
const { assignment: loadedAssignment } = result.value;
|
||||
|
||||
assignment.value = {
|
||||
...loadedAssignment,
|
||||
};
|
||||
await nextTick();
|
||||
|
||||
assignment.value.submission = Object.assign(initialSubmission, assignment.value.submission);
|
||||
|
||||
if (assignmentDiv.value) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue