mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-21 16:21:25 +02:00
Fix parsing notification timestamp
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
use std::time::SystemTime;
|
use std::time::SystemTime;
|
||||||
|
|
||||||
use chrono::{Duration, NaiveDateTime, Utc};
|
use chrono::{DateTime, Duration, Utc};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use reqwest::Method;
|
use reqwest::Method;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@@ -23,7 +23,7 @@ pub struct YaakNotifier {
|
|||||||
#[derive(sqlx::FromRow, Debug, Clone, Serialize, Deserialize, Default)]
|
#[derive(sqlx::FromRow, Debug, Clone, Serialize, Deserialize, Default)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
pub struct YaakNotification {
|
pub struct YaakNotification {
|
||||||
timestamp: NaiveDateTime,
|
timestamp: DateTime<Utc>,
|
||||||
id: String,
|
id: String,
|
||||||
message: String,
|
message: String,
|
||||||
action: Option<YaakNotificationAction>,
|
action: Option<YaakNotificationAction>,
|
||||||
@@ -77,7 +77,7 @@ impl YaakNotifier {
|
|||||||
|
|
||||||
let age = notification
|
let age = notification
|
||||||
.timestamp
|
.timestamp
|
||||||
.signed_duration_since(Utc::now().naive_utc());
|
.signed_duration_since(Utc::now());
|
||||||
let seen = get_kv(app).await?;
|
let seen = get_kv(app).await?;
|
||||||
if seen.contains(¬ification.id) || (age > Duration::days(1)) {
|
if seen.contains(¬ification.id) || (age > Duration::days(1)) {
|
||||||
debug!("Already seen notification {}", notification.id);
|
debug!("Already seen notification {}", notification.id);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"productName": "yaak",
|
"productName": "yaak",
|
||||||
"version": "2024.6.4",
|
"version": "2024.6.5-beta.1",
|
||||||
"identifier": "app.yaak.desktop",
|
"identifier": "app.yaak.desktop",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeBuildCommand": "npm run build",
|
"beforeBuildCommand": "npm run build",
|
||||||
@@ -27,7 +27,6 @@
|
|||||||
"desktop": {
|
"desktop": {
|
||||||
"schemes": [
|
"schemes": [
|
||||||
"yaak"
|
"yaak"
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user