Skip to content

Commit

Permalink
1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Zephira58 committed Sep 18, 2022
1 parent cfc76c6 commit 83aee20
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "webhook_sender"
version = "1.2.2"
version = "1.2.3"
edition = "2021"
authors = ["Xanthus58 <xanthus58@protonmail.com>"]
license = "MIT"
Expand Down
10 changes: 2 additions & 8 deletions src/app.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::sync::mpsc::channel;
use std::thread;
use std::time::Duration;

Expand Down Expand Up @@ -155,14 +154,9 @@ impl eframe::App for MyApp {
ui.label(&self.message);

//UI for the buttons and error handling
let (sender, receiver) = channel();
ui.horizontal(|ui| {
if ui.button("Generate an insult").clicked() {
thread::spawn(move || {
sender.send(get_insult()).expect("Failed to fetch insult");
});
self.message = receiver.recv().expect("Failed to get insult");
//self.message = get_insult();
self.message = get_insult();
cb(self.toasts.success("Generation Successful!")); //Sends a success toast
}

Expand Down Expand Up @@ -200,7 +194,7 @@ impl eframe::App for MyApp {
}

if !error{
send_message(&self.message, &self.webhook, &self.username, &self.avatar_url, );
send_message(&self.message, &self.webhook, &self.username, &self.avatar_url);
cb(self.toasts.success("Message Sent!"));
self.message = "".to_string();
}
Expand Down

0 comments on commit 83aee20

Please sign in to comment.