Add "trusted" and "source" to Timetable

This commit is contained in:
2022-08-21 00:50:06 +02:00
parent b879f48c61
commit 5fd7ae44fd
4 changed files with 35 additions and 6 deletions

View File

@ -22,7 +22,7 @@ watch(timetableGroups, (newValue) => {
export const selectedDate = ref(new Date(new Date().setUTCHours(0, 0, 0, 0)));
export const selectedDay = computed(() => selectedDate.value.getDay() - 1);
export const timetable = ref([]);
export const timetable = ref({ trusted: true });
export const substitutions = ref([]);
export const history = ref([]);
export const classList = ref([]);
@ -48,7 +48,8 @@ export const substitutionsForDate = computed(() => {
});
export const parsedTimetable = computed(() => {
return timetable.value.map((day) => {
if (!timetable.value.data) return [];
return timetable.value.data.map((day) => {
const newDay = [];
for (const lesson of day) {
var usedLesson = lesson;
@ -76,7 +77,8 @@ export const parsedTimetable = computed(() => {
export const possibleTimetableGroups = computed(() => {
const foundTimetableGroups = [];
for (const day of timetable.value) {
if (!timetable.value.data) return [];
for (const day of timetable.value.data) {
for (const lesson of day) {
if (Array.isArray(lesson)) {
for (const group of lesson) {