Skip to content

Commit

Permalink
fix demos
Browse files Browse the repository at this point in the history
  • Loading branch information
laves committed Oct 18, 2023
1 parent 4557c2f commit f37ee26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion demo/ios-swiftui/BaristaDemo/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ struct ContentView: View {
.frame(minWidth: 0, maxWidth: UIScreen.main.bounds.width - 50)
.font(.body)
.opacity(viewModel.errorMessage.isEmpty ? 0 : 1)
.cornerRadius(.infinity)
.cornerRadius(10)
Text("Listening...")
.font(.body)
.foregroundColor(activeBlue)
Expand Down
4 changes: 2 additions & 2 deletions demo/ios-swiftui/BaristaDemo/ViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ViewModel: ObservableObject {

init() {
do {
picovoiceManager = PicovoiceManager(
picovoiceManager = try PicovoiceManager(
accessKey: ACCESS_KEY,
keywordPath: keywordPath!,
onWakeWordDetection: {
Expand Down Expand Up @@ -89,7 +89,7 @@ class ViewModel: ObservableObject {

try picovoiceManager.start()
} catch let error as PicovoiceInvalidArgumentError {
errorMessage = "\(error.localizedDescription)\nEnsure your AccessKey '\(ACCESS_KEY)' is valid"
errorMessage = "\(error.localizedDescription)"
} catch is PicovoiceActivationError {
errorMessage = "ACCESS_KEY activation error"
} catch is PicovoiceActivationRefusedError {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2021 Picovoice Inc.
// Copyright 2021-2023 Picovoice Inc.
// You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
// file accompanying this source.
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
Expand Down Expand Up @@ -41,7 +41,7 @@ struct ContentView: View {
}

do {
self.picovoiceManager = PicovoiceManager(
self.picovoiceManager = try PicovoiceManager(
accessKey: self.ACCESS_KEY,
keywordPath: self.keywordPath!,
onWakeWordDetection: {
Expand Down Expand Up @@ -74,7 +74,7 @@ struct ContentView: View {
Sound.category = .playAndRecord
NotificationManager.shared.requestNotificationAuthorization()
} catch let error as PicovoiceInvalidArgumentError {
errorMessage = "\(error.localizedDescription)\nEnsure your AccessKey '\(ACCESS_KEY)' is valid"
errorMessage = "\(error.localizedDescription)"
} catch is PicovoiceActivationError {
errorMessage = "ACCESS_KEY activation error"
} catch is PicovoiceActivationRefusedError {
Expand Down Expand Up @@ -107,7 +107,7 @@ struct ContentView: View {
.frame(minWidth: 0, maxWidth: UIScreen.main.bounds.width - 50)
.font(.body)
.opacity(errorMessage.isEmpty ? 0 : 1)
.cornerRadius(.infinity)
.cornerRadius(10)

Spacer()
Text("""
Expand Down

0 comments on commit f37ee26

Please sign in to comment.