Fix parsing notification timestamp

This commit is contained in:
Gregory Schier
2024-06-17 11:43:20 -07:00
parent 2589e3e0dd
commit ab1224c997
2 changed files with 4 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
use std::time::SystemTime;
use chrono::{Duration, NaiveDateTime, Utc};
use chrono::{DateTime, Duration, Utc};
use log::debug;
use reqwest::Method;
use serde::{Deserialize, Serialize};
@@ -23,7 +23,7 @@ pub struct YaakNotifier {
#[derive(sqlx::FromRow, Debug, Clone, Serialize, Deserialize, Default)]
#[serde(default, rename_all = "camelCase")]
pub struct YaakNotification {
timestamp: NaiveDateTime,
timestamp: DateTime<Utc>,
id: String,
message: String,
action: Option<YaakNotificationAction>,
@@ -77,7 +77,7 @@ impl YaakNotifier {
let age = notification
.timestamp
.signed_duration_since(Utc::now().naive_utc());
.signed_duration_since(Utc::now());
let seen = get_kv(app).await?;
if seen.contains(&notification.id) || (age > Duration::days(1)) {
debug!("Already seen notification {}", notification.id);

View File

@@ -1,6 +1,6 @@
{
"productName": "yaak",
"version": "2024.6.4",
"version": "2024.6.5-beta.1",
"identifier": "app.yaak.desktop",
"build": {
"beforeBuildCommand": "npm run build",
@@ -27,7 +27,6 @@
"desktop": {
"schemes": [
"yaak"
]
}
},