mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-10 16:27:05 +02:00
feat(deep-link): Add deep link support for desktop (#916)
This commit is contained in:
committed by
Lucas Nogueira
parent
eb1679b997
commit
021d23bef3
@@ -14,3 +14,33 @@ pub(crate) async fn get_current<R: Runtime>(
|
||||
) -> Result<Option<Vec<url::Url>>> {
|
||||
deep_link.get_current()
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn register<R: Runtime>(
|
||||
_app: AppHandle<R>,
|
||||
_window: Window<R>,
|
||||
deep_link: State<'_, DeepLink<R>>,
|
||||
protocol: String,
|
||||
) -> Result<()> {
|
||||
deep_link.register(protocol)
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn unregister<R: Runtime>(
|
||||
_app: AppHandle<R>,
|
||||
_window: Window<R>,
|
||||
deep_link: State<'_, DeepLink<R>>,
|
||||
protocol: String,
|
||||
) -> Result<()> {
|
||||
deep_link.unregister(protocol)
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn is_registered<R: Runtime>(
|
||||
_app: AppHandle<R>,
|
||||
_window: Window<R>,
|
||||
deep_link: State<'_, DeepLink<R>>,
|
||||
protocol: String,
|
||||
) -> Result<bool> {
|
||||
deep_link.is_registered(protocol)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user