Something went wrong. Try again.
🎺 A desktop music player that brings your music from multiple places together
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748import SwiftUI
struct ContentView: View { @State private var isAuthenticating = false @State private var authErrorMessage: String?
var body: some View { VStack(spacing: 10) { HStack { Image(systemName: "waveform") .imageScale(.large) .foregroundStyle(.tint) Text("Welcome to Echoes") }
Button("Connect OneDrive") { startAuthentication() } .disabled(isAuthenticating)
if let authErrorMessage { Text(authErrorMessage) .foregroundStyle(.red) } } .padding() }
private func startAuthentication() { isAuthenticating = true authErrorMessage = nil
let startUrl = ProviderBridge.start_authentication(.oneDrive) { success, errorMessage in // Already hopped back to the main queue on the Objective-C++ side. isAuthenticating = false authErrorMessage = success ? nil : (errorMessage ?? "Unknown error") }
if let url = URL(string: startUrl) { NSWorkspace.shared.open(url) } }}
#Preview { ContentView()}