Tusker/Tusker/API/FetchStatusSourceService.swift

27 lines
660 B
Swift

//
// FetchStatusSourceService.swift
// Tusker
//
// Created by Shadowfacts on 5/10/23.
// Copyright © 2023 Shadowfacts. All rights reserved.
//
import Foundation
import Pachyderm
@MainActor
class FetchStatusSourceService {
let statusID: String
let delegate: TuskerNavigationDelegate
init(statusID: String, delegate: TuskerNavigationDelegate) {
self.statusID = statusID
self.delegate = delegate
}
func run() async throws -> StatusSource {
// todo: show loading indicator if this takes longer than a certain time
return try await delegate.apiController.run(Status.source(statusID)).0
}
}