This commit is contained in:
1 parent
c9a2eeb53d
commit
946a477397
9 files changed
+967
-5
No files matched your search
@@ -6,11 +6,10 @@ use crate::event::{
|
||||
};
|
||||
#[cfg(feature = "tauri")]
|
||||
use crate::event::{
|
||||
InstancePayload, JavaDiscoveryPayload, JavaDownloadConfirmationPayload,
|
||||
LoadingPayload, ProcessPayload, ServerPayload, WarningPayload,
|
||||
InstanceGroupsChangedPayload, InstancePayload, JavaDiscoveryPayload,
|
||||
JavaDownloadConfirmationPayload, LoadingPayload, ProcessPayload,
|
||||
ServerPayload, WarningPayload,
|
||||
};
|
||||
use futures::prelude::*;
|
||||
use serde_json::Value;
|
||||
#[cfg(feature = "tauri")]
|
||||
use std::sync::LazyLock;
|
||||
#[cfg(feature = "tauri")]
|
||||
@@ -488,6 +487,26 @@ pub async fn emit_friend(payload: FriendPayload) -> crate::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
pub async fn emit_instance_groups_changed(
|
||||
instance_ids: &[String],
|
||||
) -> crate::Result<()> {
|
||||
#[cfg(feature = "tauri")]
|
||||
{
|
||||
let event_state = crate::EventState::get()?;
|
||||
event_state
|
||||
.app
|
||||
.emit(
|
||||
"instance_groups_changed",
|
||||
InstanceGroupsChangedPayload {
|
||||
instance_ids: instance_ids.to_vec(),
|
||||
},
|
||||
)
|
||||
.map_err(EventError::from)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
pub async fn emit_notification(payload: Value) -> crate::Result<()> {
|
||||
#[cfg(feature = "tauri")]
|
||||
|
||||
@@ -395,6 +395,10 @@ pub enum ServerPayloadType {
|
||||
eula_text: String,
|
||||
},
|
||||
}
|
||||
#[derive(Serialize, Clone)]
|
||||
pub struct InstanceGroupsChangedPayload {
|
||||
pub instance_ids: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Clone)]
|
||||
#[cfg(feature = "tauri")]
|
||||
|
||||
Reference in new issue
Block a user