Load incomplete content, show errors

This commit is contained in:
Christoph Hagen
2025-02-05 20:56:02 +01:00
parent 2b88584ba1
commit d556a51228
9 changed files with 142 additions and 118 deletions

View File

@ -16,9 +16,13 @@ extension Content {
}
func saveIfNeeded() {
guard saveState != .isSaved else {
switch saveState {
case .isSaved, .savingPausedDueToLoadErrors, .storageNotInitialized:
return
default:
break
}
if Date.now.timeIntervalSince(lastModification) < 5 {
// Additional modification made
// Wait for next scheduled invocation of saveIfNeeded()
@ -43,7 +47,6 @@ extension Content {
}
private func saveToDisk() -> Bool {
guard didLoadContent else { return false }
guard storage.contentScope != nil else {
print("Storage not initialized, not saving content")
return false