hopefully fixed a bug

This commit is contained in:
2025-06-28 18:29:25 +02:00
parent 6ff9cafc34
commit 4dc878f1c4
+4 -4
View File
@@ -26,10 +26,6 @@ pub async fn cmd(
let shorturl_u = to_shorturl(&url);
let shorturl = &shorturl_u.unwrap_or(url.clone());
data::update_re_data(ctx.data()).await;
let reddit_data = get_mutex_data(&ctx.data().reddit_data).await?;
if let Some(bk_week) = reddit_data.get(CFG_DATA_RE) {
let a = approve.unwrap_or(false);
let r = send_cmd_json("add_post_url", Some(json!([&shorturl, a, true])), true).await.unwrap();
@@ -45,6 +41,10 @@ pub async fn cmd(
return Ok(());
}
data::update_re_data(ctx.data()).await;
let reddit_data = get_mutex_data(&ctx.data().reddit_data).await?;
if let Some(bk_week) = reddit_data.get(CFG_DATA_RE) {
if let Some(post) = bk_week.get(shorturl) {
if post["removed"]["removed"].as_bool().unwrap()
{ send_msg(ctx, lang!("dc_msg_re_post_unremove_success", &shorturl), true, true).await; }