mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Supports blocking third-party sources
Blocked sources cannot be added by new users, or updated for existing users.
This commit is contained in:
@@ -62,7 +62,7 @@ final class SourcesViewController: UICollectionViewController
|
||||
private lazy var addedSourcesDataSource = self.makeAddedSourcesDataSource()
|
||||
private lazy var trustedSourcesDataSource = self.makeTrustedSourcesDataSource()
|
||||
|
||||
private var fetchTrustedSourcesOperation: FetchTrustedSourcesOperation?
|
||||
private var fetchTrustedSourcesOperation: UpdateKnownSourcesOperation?
|
||||
private var fetchTrustedSourcesResult: Result<Void, Error>?
|
||||
private var _fetchTrustedSourcesContext: NSManagedObjectContext?
|
||||
|
||||
@@ -271,7 +271,6 @@ private extension SourcesViewController
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Remove this now that trusted sources aren't necessary.
|
||||
var dependencies: [Foundation.Operation] = []
|
||||
if let fetchTrustedSourcesOperation = self.fetchTrustedSourcesOperation
|
||||
{
|
||||
@@ -361,14 +360,11 @@ private extension SourcesViewController
|
||||
}
|
||||
}
|
||||
|
||||
self.fetchTrustedSourcesOperation = AppManager.shared.fetchTrustedSources { result in
|
||||
self.fetchTrustedSourcesOperation = AppManager.shared.updateKnownSources { result in
|
||||
switch result
|
||||
{
|
||||
case .failure(let error): finish(.failure(error))
|
||||
case .success(let trustedSources):
|
||||
// Cache trusted source IDs.
|
||||
UserDefaults.shared.trustedSourceIDs = trustedSources.map { $0.identifier }
|
||||
|
||||
case .success((let trustedSources, _)):
|
||||
// Don't show sources without a sourceURL.
|
||||
let featuredSourceURLs = trustedSources.compactMap { $0.sourceURL }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user