Skip to main content

set_hooks

Function set_hooks 

Source
pub async fn set_hooks(
    app: AppHandle,
    scheduler: State<'_, Scheduler>,
    hooks_enabled: bool,
    hooks: Vec<Hook>,
) -> Result<(), String>
Expand description

Replace the active profile’s hook list, gated by a native confirmation dialog. The dialog shows the proposed hooks (with control characters sanitised) so the user can spot tampering.

Returns Err if another set_hooks invocation is already showing a dialog, or if the user declines. On success, the new hooks are merged into both the in-memory settings and the active profile, then persisted to disk.