Fix history bug
This commit is contained in:
1 parent
9456eec2af
commit
c5c1f34e1c
7 files changed
+38
-34
No files matched your search
+5
-3
@@ -9,8 +9,8 @@ use chrono::Local;
|
||||
use iced::alignment::Horizontal::Center;
|
||||
use iced::keyboard::key::Physical::Code;
|
||||
use iced::widget::text::Style;
|
||||
use iced::widget::{Column, button, column, container, row, rule, space, text, tooltip};
|
||||
use iced::{Element, Fill, Task, Theme, alignment, keyboard};
|
||||
use iced::widget::{button, column, container, row, rule, space, text, tooltip, Column};
|
||||
use iced::{alignment, keyboard, Element, Fill, Task, Theme};
|
||||
use parking_lot::Mutex;
|
||||
use rodio::MixerDeviceSink;
|
||||
use std::collections::HashSet;
|
||||
@@ -319,7 +319,9 @@ pub enum RepetitionMessage {
|
||||
async fn play_sound(sink: Arc<MixerDeviceSink>, text: String) {
|
||||
if let Ok(data) = get_voice(text.as_str()).await {
|
||||
spawn_blocking(move || {
|
||||
rodio::play(sink.mixer(), data).unwrap().sleep_until_end();
|
||||
if let Ok(play) = rodio::play(sink.mixer(), data) {
|
||||
play.sleep_until_end()
|
||||
}
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
Reference in new issue
Block a user