mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-04 14:33:34 +00:00
parent
f97a761346
commit
947354f6c0
|
@ -64,16 +64,12 @@ pub enum CoreEvent {
|
|||
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Type)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum BackendFeature {
|
||||
FilesOverP2P,
|
||||
CloudSync,
|
||||
}
|
||||
|
||||
impl BackendFeature {
|
||||
pub fn restore(&self, node: &Node) {
|
||||
match self {
|
||||
BackendFeature::FilesOverP2P => {
|
||||
node.files_over_p2p_flag.store(true, Ordering::Relaxed);
|
||||
}
|
||||
BackendFeature::CloudSync => {
|
||||
node.cloud_sync_flag.store(true, Ordering::Relaxed);
|
||||
}
|
||||
|
@ -181,9 +177,6 @@ pub(crate) fn mount() -> Arc<Router> {
|
|||
.map_err(|err| rspc::Error::new(ErrorCode::InternalServerError, err.to_string()))?;
|
||||
|
||||
match feature {
|
||||
BackendFeature::FilesOverP2P => {
|
||||
node.files_over_p2p_flag.store(enabled, Ordering::Relaxed);
|
||||
}
|
||||
BackendFeature::CloudSync => {
|
||||
node.cloud_sync_flag.store(enabled, Ordering::Relaxed);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,6 @@ pub struct Node {
|
|||
pub event_bus: (broadcast::Sender<CoreEvent>, broadcast::Receiver<CoreEvent>),
|
||||
pub notifications: Notifications,
|
||||
pub thumbnailer: OldThumbnailer,
|
||||
pub files_over_p2p_flag: Arc<AtomicBool>,
|
||||
pub cloud_sync_flag: Arc<AtomicBool>,
|
||||
pub env: Arc<env::Env>,
|
||||
pub http: reqwest::Client,
|
||||
|
@ -135,7 +134,6 @@ impl Node {
|
|||
config,
|
||||
event_bus,
|
||||
libraries,
|
||||
files_over_p2p_flag: Arc::new(AtomicBool::new(false)),
|
||||
cloud_sync_flag: Arc::new(AtomicBool::new(false)),
|
||||
http: reqwest::Client::new(),
|
||||
env,
|
||||
|
|
|
@ -154,7 +154,7 @@ export type AudioMetadata = { duration: number | null; audio_codec: string | nul
|
|||
*
|
||||
* If you want a variant of this to show up on the frontend it must be added to `backendFeatures` in `useFeatureFlag.tsx`
|
||||
*/
|
||||
export type BackendFeature = "filesOverP2P" | "cloudSync"
|
||||
export type BackendFeature = "cloudSync"
|
||||
|
||||
export type Backup = ({ id: string; timestamp: string; library_id: string; library_name: string }) & { path: string }
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ export const features = [
|
|||
|
||||
// This defines which backend feature flags show up in the UI.
|
||||
// This is kinda a hack to not having the runtime array of possible features as Specta only exports the types.
|
||||
export const backendFeatures: BackendFeature[] = ['filesOverP2P', 'cloudSync'];
|
||||
export const backendFeatures: BackendFeature[] = ['cloudSync'];
|
||||
|
||||
export type FeatureFlag = (typeof features)[number] | BackendFeature;
|
||||
|
||||
|
|
Loading…
Reference in a new issue