Create folders in Account module for each account type.

This commit is contained in:
Brent Simmons 2024-05-01 21:03:59 -07:00
parent 8de7b56f61
commit a1c2a2b43a
9 changed files with 16 additions and 26 deletions

View File

@ -765,6 +765,22 @@ final class FeedlyAccountDelegate: AccountDelegate {
try await updateAccountFeeds(parsedItems: parsedItems)
}
@MainActor struct FeedlyFeedContainerValidator {
var container: Container
func getValidContainer() throws -> (Folder, String) {
guard let folder = container as? Folder else {
throw FeedlyAccountDelegateError.addFeedChooseFolder
}
guard let collectionID = folder.externalID else {
throw FeedlyAccountDelegateError.addFeedInvalidFolder(folder.nameForDisplay)
}
return (folder, collectionID)
}
}
func addNewFeed(url: String, feedName: String?, container: Container) async throws {
let validator = FeedlyFeedContainerValidator(container: container)

View File

@ -1,26 +0,0 @@
//
// FeedlyFeedContainerValidator.swift
// Account
//
// Created by Kiel Gillard on 10/10/19.
// Copyright © 2019 Ranchero Software, LLC. All rights reserved.
//
import Foundation
import Feedly
@MainActor struct FeedlyFeedContainerValidator {
var container: Container
func getValidContainer() throws -> (Folder, String) {
guard let folder = container as? Folder else {
throw FeedlyAccountDelegateError.addFeedChooseFolder
}
guard let collectionID = folder.externalID else {
throw FeedlyAccountDelegateError.addFeedInvalidFolder(folder.nameForDisplay)
}
return (folder, collectionID)
}
}