Move AppState to radicle-types

This commit is contained in:
Sebastian Martinez
2024-12-02 16:30:54 +01:00
parent f5d559158b
commit b7b71ccb11
2 changed files with 28 additions and 25 deletions
+1 -25
View File
@@ -6,34 +6,10 @@ use tauri::Manager;
use radicle::node::Handle;
use radicle::Node;
use radicle_types::error::Error;
use radicle_types::traits::auth::Auth;
use radicle_types::traits::cobs::Cobs;
use radicle_types::traits::issue::{Issues, IssuesMut};
use radicle_types::traits::patch::{Patches, PatchesMut};
use radicle_types::traits::repo::Repo;
use radicle_types::traits::thread::Thread;
use radicle_types::traits::Profile;
use radicle_types::AppState;
use commands::{auth, cob, diff, profile, repo, thread};
struct AppState {
profile: radicle::Profile,
}
impl Auth for AppState {}
impl Repo for AppState {}
impl Thread for AppState {}
impl Cobs for AppState {}
impl Issues for AppState {}
impl IssuesMut for AppState {}
impl Patches for AppState {}
impl PatchesMut for AppState {}
impl Profile for AppState {
fn profile(&self) -> radicle::Profile {
self.profile.clone()
}
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
#[cfg(debug_assertions)]
+27
View File
@@ -1,5 +1,32 @@
use traits::auth::Auth;
use traits::cobs::Cobs;
use traits::issue::{Issues, IssuesMut};
use traits::patch::{Patches, PatchesMut};
use traits::repo::Repo;
use traits::thread::Thread;
use traits::Profile;
pub mod cobs;
pub mod config;
pub mod error;
pub mod repo;
pub mod test;
pub mod traits;
pub struct AppState {
pub profile: radicle::Profile,
}
impl Auth for AppState {}
impl Repo for AppState {}
impl Thread for AppState {}
impl Cobs for AppState {}
impl Issues for AppState {}
impl IssuesMut for AppState {}
impl Patches for AppState {}
impl PatchesMut for AppState {}
impl Profile for AppState {
fn profile(&self) -> radicle::Profile {
self.profile.clone()
}
}