mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 18:20:30 +08:00
Move Version into radicle-types
This commit is contained in:
@@ -1,28 +1,13 @@
|
||||
use serde::Serialize;
|
||||
use tauri::{AppHandle, Emitter, Manager};
|
||||
|
||||
use radicle::cob::cache::COBS_DB_FILE;
|
||||
use radicle::node::{Handle, Node, NOTIFICATIONS_DB_FILE};
|
||||
|
||||
use radicle_types::config::Config;
|
||||
use radicle_types::config::{Config, Version};
|
||||
use radicle_types::error::Error;
|
||||
use radicle_types::traits::Profile;
|
||||
use radicle_types::{domain, AppState};
|
||||
|
||||
pub struct Version {
|
||||
pub version: String,
|
||||
pub head: String,
|
||||
}
|
||||
|
||||
impl Serialize for Version {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: serde::Serializer,
|
||||
{
|
||||
serializer.serialize_str(&format!("{} ({})", self.version, self.head))
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub(crate) fn version(app: AppHandle) -> Result<Version, Error> {
|
||||
Ok(Version {
|
||||
|
||||
@@ -22,3 +22,17 @@ pub struct Config {
|
||||
#[ts(type = "{ default: 'allow', scope: 'followed' | 'all' } | { default: 'block' }")]
|
||||
pub seeding_policy: DefaultSeedingPolicy,
|
||||
}
|
||||
|
||||
pub struct Version {
|
||||
pub version: String,
|
||||
pub head: String,
|
||||
}
|
||||
|
||||
impl Serialize for Version {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: serde::Serializer,
|
||||
{
|
||||
serializer.serialize_str(&format!("{} ({})", self.version, self.head))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user