Sources can now be updated based on the repo ID. To preserve repo IDs across single URL links, the source lists can be edited and the ID is transferred over. Signed-off-by: kingbri <bdashore3@gmail.com>
35 lines
850 B
Swift
35 lines
850 B
Swift
//
|
|
// SourceUpdateButtonView.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 8/5/22.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct SourceUpdateButtonView: View {
|
|
@EnvironmentObject var sourceManager: SourceManager
|
|
|
|
let updatedSource: SourceJson
|
|
|
|
var body: some View {
|
|
HStack {
|
|
VStack(alignment: .leading, spacing: 5) {
|
|
HStack {
|
|
Text(updatedSource.name)
|
|
Text("v\(updatedSource.version)")
|
|
.foregroundColor(.secondary)
|
|
}
|
|
|
|
Text("by \(updatedSource.author ?? "Unknown")")
|
|
.foregroundColor(.secondary)
|
|
}
|
|
|
|
Spacer()
|
|
|
|
Button("Update") {
|
|
sourceManager.installSource(sourceJson: updatedSource, doUpsert: true)
|
|
}
|
|
}
|
|
}
|
|
}
|