diff --git a/theseus_gui/src-tauri/src/api/profile_share.rs b/theseus_gui/src-tauri/src/api/profile_share.rs index efa903f69..f077374cf 100644 --- a/theseus_gui/src-tauri/src/api/profile_share.rs +++ b/theseus_gui/src-tauri/src/api/profile_share.rs @@ -10,7 +10,9 @@ pub fn init() -> tauri::plugin::TauriPlugin { profile_share_inbound_sync, profile_share_outbound_sync, profile_share_generate_share_link, - profile_share_accept_share_link + profile_share_accept_share_link, + profile_share_remove_users, + profile_share_remove_links ]) .build() } @@ -73,4 +75,22 @@ pub async fn profile_share_accept_share_link( ) -> Result<()> { shared_profile::accept_share_link(link).await?; Ok(()) +} + +#[tauri::command] +pub async fn profile_share_remove_users( + path : ProfilePathId, + users: Vec +) -> Result<()> { + shared_profile::remove_shared_profile_users(path, users).await?; + Ok(()) +} + +#[tauri::command] +pub async fn profile_share_remove_links( + path : ProfilePathId, + links : Vec +) -> Result<()> { + shared_profile::remove_shared_profile_links(path, links).await?; + Ok(()) } \ No newline at end of file diff --git a/theseus_gui/src/helpers/shared_profiles.js b/theseus_gui/src/helpers/shared_profiles.js index 9d0878933..ef4034400 100644 --- a/theseus_gui/src/helpers/shared_profiles.js +++ b/theseus_gui/src/helpers/shared_profiles.js @@ -20,6 +20,16 @@ export async function share_accept(link) { return await invoke('plugin:profile_share|profile_share_accept', { link }) } +/// Removes users from a shared profile +export async function remove_users(path, users) { + return await invoke('plugin:profile_share|profile_share_remove_users', { path, users }) +} + +/// Removes links from a shared profile +export async function remove_links(path, links) { + return await invoke('plugin:profile_share|profile_share_remove_links', { path, links }) +} + /// Install a pack from a shared profile id export async function share_install(id) { return await invoke('plugin:profile_share|profile_share_install', { id }) diff --git a/theseus_gui/src/pages/instance/Options.vue b/theseus_gui/src/pages/instance/Options.vue index 764f1fa17..e1f55e511 100644 --- a/theseus_gui/src/pages/instance/Options.vue +++ b/theseus_gui/src/pages/instance/Options.vue @@ -483,8 +483,8 @@
-
-
@@ -633,7 +633,8 @@ import { get_all, outbound_sync, inbound_sync, - share_generate + share_generate, + remove_users, } from '@/helpers/shared_profiles.js' import { computed, readonly, ref, shallowRef, watch } from 'vue' import { get_max_memory } from '@/helpers/jre.js' @@ -1042,6 +1043,10 @@ async function generateShareLink() { shareLink.value = await share_generate(props.instance.path).catch(handleError) } +async function removeSharedPackUser(user) { + await remove_users(props.instance.path, [user]).catch(handleError) +} +