Backups in Ferrite archive a user's bookmarks, history, source lists, and source names. Sources are not archived due to the size of the backup increasing exponentially. These files use the .feb format to avoid JSON conflicts when opening the file in Ferrite. The backup file can be renamed to JSON for editing at any time. Add the Backport namespace to be used for ported features rather than making a file for every iOS 14 adaptation. Move history and bookmark creation to the PersistenceController rather than individual functions. Signed-off-by: kingbri <bdashore3@proton.me>
40 lines
1.3 KiB
Swift
40 lines
1.3 KiB
Swift
//
|
|
// FerriteApp.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 7/1/22.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
@main
|
|
struct FerriteApp: App {
|
|
let persistenceController = PersistenceController.shared
|
|
|
|
@StateObject var scrapingModel: ScrapingViewModel = .init()
|
|
@StateObject var toastModel: ToastViewModel = .init()
|
|
@StateObject var debridManager: DebridManager = .init()
|
|
@StateObject var navModel: NavigationViewModel = .init()
|
|
@StateObject var sourceManager: SourceManager = .init()
|
|
@StateObject var backupManager: BackupManager = .init()
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
MainView()
|
|
.onAppear {
|
|
scrapingModel.toastModel = toastModel
|
|
debridManager.toastModel = toastModel
|
|
sourceManager.toastModel = toastModel
|
|
backupManager.toastModel = toastModel
|
|
navModel.toastModel = toastModel
|
|
}
|
|
.environmentObject(debridManager)
|
|
.environmentObject(scrapingModel)
|
|
.environmentObject(toastModel)
|
|
.environmentObject(navModel)
|
|
.environmentObject(sourceManager)
|
|
.environmentObject(backupManager)
|
|
.environment(\.managedObjectContext, persistenceController.container.viewContext)
|
|
}
|
|
}
|
|
}
|