mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-04 20:11:48 +02:00
Tweak message size placeholder and notifications
This commit is contained in:
@@ -435,7 +435,7 @@ function MessageSizeSettingRow({
|
|||||||
: inheritedValue
|
: inheritedValue
|
||||||
: setting;
|
: setting;
|
||||||
const displayValue = formatMegabytes(value);
|
const displayValue = formatMegabytes(value);
|
||||||
const placeholder = formatMegabytes(settingDefinition.defaultValue);
|
const placeholder = "0";
|
||||||
|
|
||||||
if (!inherited) {
|
if (!inherited) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use crate::models_ext::QueryManagerExt;
|
|||||||
use chrono::{NaiveDateTime, Utc};
|
use chrono::{NaiveDateTime, Utc};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use std::sync::OnceLock;
|
use std::sync::OnceLock;
|
||||||
use tauri::{AppHandle, Runtime};
|
use tauri::{AppHandle, Runtime, is_dev};
|
||||||
use yaak_models::util::UpdateSource;
|
use yaak_models::util::UpdateSource;
|
||||||
|
|
||||||
const NAMESPACE: &str = "analytics";
|
const NAMESPACE: &str = "analytics";
|
||||||
@@ -36,6 +36,10 @@ pub fn get_or_upsert_launch_info<R: Runtime>(app_handle: &AppHandle<R>) -> &Laun
|
|||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if is_dev() {
|
||||||
|
info.current_version = "0.0.1".to_string();
|
||||||
|
}
|
||||||
|
|
||||||
app_handle
|
app_handle
|
||||||
.with_tx(|tx| {
|
.with_tx(|tx| {
|
||||||
// Load the previously tracked version
|
// Load the previously tracked version
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ impl YaakNotifier {
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!("Checking for notifications");
|
info!("Checking for notifications");
|
||||||
|
|
||||||
#[cfg(feature = "license")]
|
#[cfg(feature = "license")]
|
||||||
let license_check = {
|
let license_check = {
|
||||||
@@ -115,17 +115,20 @@ impl YaakNotifier {
|
|||||||
]);
|
]);
|
||||||
let resp = req.send().await?;
|
let resp = req.send().await?;
|
||||||
if resp.status() != 200 {
|
if resp.status() != 200 {
|
||||||
debug!("Skipping notification status code {}", resp.status());
|
info!("Skipping notification status code {}", resp.status());
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
for notification in resp.json::<Vec<YaakNotification>>().await? {
|
let notifications = resp.json::<Vec<YaakNotification>>().await?;
|
||||||
|
debug!("Received {} notifications", notifications.len());
|
||||||
|
|
||||||
|
for notification in notifications {
|
||||||
let seen = get_kv(app_handle).await?;
|
let seen = get_kv(app_handle).await?;
|
||||||
if seen.contains(¬ification.id) {
|
if seen.contains(¬ification.id) {
|
||||||
debug!("Already seen notification {}", notification.id);
|
debug!("Already seen notification {}", notification.id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
debug!("Got notification {:?}", notification);
|
info!("Got notification {:?}", notification);
|
||||||
|
|
||||||
let _ = app_handle.emit_to(window.label(), "notification", notification.clone());
|
let _ = app_handle.emit_to(window.label(), "notification", notification.clone());
|
||||||
break; // Only show one notification
|
break; // Only show one notification
|
||||||
|
|||||||
Reference in New Issue
Block a user