Skip to content

Commit

Permalink
Fixed issue with Q & A string formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinbjornt committed May 22, 2023
1 parent 55ffc51 commit b8c68b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class SessionRouteState extends State<SessionRoute> with SingleTickerProviderSta
// App went into background - FGBGType.background
dlog("App went into background");
inBackground = true;
if (session!.isActive()) {
if (session != null && session!.isActive()) {
await session!.stop();
} else {
if (HotwordDetector().isActive()) {
Expand Down Expand Up @@ -338,7 +338,9 @@ class SessionRouteState extends State<SessionRoute> with SingleTickerProviderSta
// }

// Update text field with response
String t = "${resp["q"].sentenceCapitalized()}\n\n${resp["answer"].sentenceCapitalized()}";
final String q = "${resp['q']}".sentenceCapitalized();
final String a = "${resp['answer']}".sentenceCapitalized();
String t = "$q\n\n$a";
if (resp['source'] != null && resp['source'] != '') {
t += " (${resp['source']})";
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: embla
description: Cross-platform mobile Icelandic-language voice assistant.
publish_to: 'none'
version: 1.4.0+591
version: 1.4.0+592
homepage: https://embla.is
repository: https://github.com/mideind/EmblaFlutterApp

Expand Down

0 comments on commit b8c68b2

Please sign in to comment.