Skip to content

Commit

Permalink
Add progress indicator for roles
Browse files Browse the repository at this point in the history
  • Loading branch information
milanvarady committed Apr 27, 2024
1 parent d147915 commit 06330a7
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import UniformTypeIdentifiers

struct RolesSettingsView: View {
@StateObject var rolesManager = RolesManager()


@State var loadingRoles = false

var body: some View {
VStack {
ZStack {
Expand All @@ -22,11 +24,21 @@ struct RolesSettingsView: View {
if self.rolesManager.roles.isEmpty {
Text("Drag & Drop Final Cut Pro Project (or .FCPXMLD) to Retrive Roles Metadata")
}

if loadingRoles {
ProgressView()
}
}

buttonsView
}
.onDrop(of: [.fcpxml, .fileURL], isTargeted: nil) { providers -> Bool in
self.loadingRoles = true

defer {
self.loadingRoles = false
}

for provider in providers {
// Load FCPXML
if provider.hasRepresentationConforming(toTypeIdentifier: "com.apple.finalcutpro.xml") {
Expand Down

0 comments on commit 06330a7

Please sign in to comment.