moved settings into their own object

This commit is contained in:
2023-09-22 12:58:37 -06:00
parent e53222e35d
commit fa792f1f23
20 changed files with 81 additions and 70 deletions

View File

@@ -37,26 +37,12 @@ public class CoursePlanner
StateHasChanged?.Invoke();
return;
}
var courseWithSettings = value with
{
Settings = value.Settings with
{
AssignmentGroups = value.AssignmentGroups,
Name = value.Settings.Name,
DaysOfWeek = value.DaysOfWeek,
CanvasId = value.Settings.CanvasId,
StartDate = value.Settings.StartDate,
DefaultDueTime = value.DefaultDueTime,
AssignmentTemplates = value.AssignmentTemplates,
}
};
var verifiedCourse = courseWithSettings.GeneralCourseCleanup();
var verifiedCourse = value.GeneralCourseCleanup();
_debounceTimer?.Dispose();
_debounceTimer = new Timer(
async (_) => await saveCourseToFile(courseWithSettings),
async (_) => await saveCourseToFile(verifiedCourse),
null,
_debounceInterval,
Timeout.Infinite
@@ -160,7 +146,13 @@ public class CoursePlanner
var newAssignmentGroups = await LocalCourse.EnsureAllAssignmentGroupsExistInCanvas(
canvasId, canvasAssignmentGroups, canvas);
LocalCourse = LocalCourse with { AssignmentGroups = newAssignmentGroups };
LocalCourse = LocalCourse with
{
Settings = LocalCourse.Settings with
{
AssignmentGroups = newAssignmentGroups
}
};
var newModules = await LocalCourse.EnsureAllModulesExistInCanvas(