fix: get correct subject and teacher for changed classes
This commit is contained in:
parent
a1e506b7b2
commit
b275800e17
1 changed files with 5 additions and 6 deletions
|
|
@ -64,8 +64,9 @@ export default class Comcigan {
|
|||
cls.slice(1).map((day, dIdx) =>
|
||||
day.slice(1).map((period, pIdx) => {
|
||||
const p = period.toString()
|
||||
const changed =
|
||||
period !== original[gIdx + 1][cIdx + 1][dIdx + 1][pIdx + 1]
|
||||
const origin =
|
||||
original[gIdx + 1][cIdx + 1][dIdx + 1][pIdx + 1].toString()
|
||||
const changed = p !== origin
|
||||
|
||||
return {
|
||||
subject: subjects[Number(p.slice(0, p.length - teachersLen - 1))],
|
||||
|
|
@ -75,12 +76,10 @@ export default class Comcigan {
|
|||
? {
|
||||
originalSubject:
|
||||
subjects[
|
||||
original[gIdx + 1][cIdx + 1][dIdx + 1][pIdx + 1]
|
||||
Number(origin.slice(0, origin.length - teachersLen - 1))
|
||||
],
|
||||
originalTeacher:
|
||||
teachers[
|
||||
original[gIdx + 1][cIdx + 1][dIdx + 1][pIdx + 1]
|
||||
],
|
||||
teachers[Number(origin.slice(-teachersLen))],
|
||||
}
|
||||
: {}),
|
||||
} as Timetable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue