mirror of
https://github.com/cranci1/Sora.git
synced 2026-05-08 11:10:31 +00:00
fixed big issue crash
This commit is contained in:
parent
3664cf9638
commit
745229cab6
4 changed files with 15 additions and 25 deletions
|
|
@ -171,7 +171,7 @@ struct MediaInfoView: View {
|
|||
EpisodeCell(episode: ep.href, episodeID: ep.number - 1, progress: progress, itemID: itemID ?? 0)
|
||||
.onTapGesture {
|
||||
fetchStream(href: ep.href)
|
||||
showDrop(title: "Fetching Stream", subtitle: "", icon: UIImage(systemName: "arrow.triangle.2.circlepath"))
|
||||
DropManager.shared.showDrop(title: "Fetching Stream", subtitle: "", duration: 1.0, icon: UIImage(systemName: "arrow.triangle.2.circlepath"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -186,7 +186,8 @@ struct MediaInfoView: View {
|
|||
}
|
||||
.onAppear {
|
||||
if !showedDrop {
|
||||
showDrop(title: "Fetching Data", subtitle: "Please wait while fetching", icon: UIImage(systemName: "arrow.triangle.2.circlepath"))
|
||||
DropManager.shared.showDrop(title: "Fetching Data", subtitle: "Please wait while fetching", duration: 1.0, icon: UIImage(systemName: "arrow.triangle.2.circlepath"))
|
||||
showedDrop = true
|
||||
}
|
||||
fetchDetails()
|
||||
fetchItemID(byTitle: title) { result in
|
||||
|
|
@ -200,13 +201,6 @@ struct MediaInfoView: View {
|
|||
}
|
||||
}
|
||||
|
||||
private func showDrop(title: String, subtitle: String, icon: UIImage?) {
|
||||
let duration = 1.0
|
||||
|
||||
DropManager.shared.showDrop(title: title, subtitle: subtitle, duration: duration, icon: icon)
|
||||
showedDrop = true
|
||||
}
|
||||
|
||||
func fetchDetails() {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||
Task {
|
||||
|
|
@ -264,7 +258,7 @@ struct MediaInfoView: View {
|
|||
}
|
||||
} catch {
|
||||
Logger.shared.log("Error loading module: \(error)", type: "Error")
|
||||
self.showDrop(title: "Stream not Found", subtitle: "", icon: UIImage(systemName: "xmark"))
|
||||
DropManager.shared.showDrop(title: "Stream not Found", subtitle: "", duration: 1.0, icon: UIImage(systemName: "xmark"))
|
||||
self.isLoading = false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ struct SettingsViewLogger: View {
|
|||
Menu {
|
||||
Button(action: {
|
||||
UIPasteboard.general.string = logs
|
||||
DropManager.shared.showDrop(title: "Copied to Clipboard", subtitle: "", duration: 1.0, icon: UIImage(systemName: "doc.on.clipboard.fill"))
|
||||
}) {
|
||||
Label("Copy to Clipboard", systemImage: "doc.on.doc")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,16 +76,8 @@ struct SettingsViewLoggerFilter: View {
|
|||
List {
|
||||
ForEach($viewModel.filters) { $filter in
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
HStack {
|
||||
Toggle(filter.type, isOn: $filter.isEnabled)
|
||||
Spacer()
|
||||
}
|
||||
|
||||
Text(filter.description)
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.secondary)
|
||||
Toggle(filter.type, isOn: $filter.isEnabled)
|
||||
}
|
||||
.padding(.vertical, 5)
|
||||
}
|
||||
}
|
||||
.navigationTitle("Log Filters")
|
||||
|
|
|
|||
|
|
@ -60,27 +60,30 @@ struct SettingsViewModule: View {
|
|||
.contextMenu {
|
||||
Button(action: {
|
||||
UIPasteboard.general.string = module.metadataUrl
|
||||
DropManager.shared.showDrop(title: "Copied to Clipboard", subtitle: "", duration: 1.0, icon: UIImage(systemName: "doc.on.clipboard.fill"))
|
||||
}) {
|
||||
Label("Copy URL", systemImage: "doc.on.doc")
|
||||
}
|
||||
Button(role: .destructive) {
|
||||
if selectedModuleId == module.id.uuidString {
|
||||
selectedModuleId = nil
|
||||
if selectedModuleId != module.id.uuidString {
|
||||
moduleManager.deleteModule(module)
|
||||
DropManager.shared.showDrop(title: "Module Removed", subtitle: "", duration: 1.0, icon: UIImage(systemName: "trash"))
|
||||
}
|
||||
moduleManager.deleteModule(module)
|
||||
} label: {
|
||||
Label("Delete", systemImage: "trash")
|
||||
}
|
||||
.disabled(selectedModuleId == module.id.uuidString)
|
||||
}
|
||||
.swipeActions {
|
||||
Button(role: .destructive) {
|
||||
if selectedModuleId == module.id.uuidString {
|
||||
selectedModuleId = nil
|
||||
if selectedModuleId != module.id.uuidString {
|
||||
moduleManager.deleteModule(module)
|
||||
DropManager.shared.showDrop(title: "Module Removed", subtitle: "", duration: 1.0, icon: UIImage(systemName: "trash"))
|
||||
}
|
||||
moduleManager.deleteModule(module)
|
||||
} label: {
|
||||
Label("Delete", systemImage: "trash")
|
||||
}
|
||||
.disabled(selectedModuleId == module.id.uuidString)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue