UnlockActiveNoteCommandHandler
A command handler that unlocks the active note. It cancels the operation that took the lock and releases the lock covering the note — whether the note is locked directly or by a subtree-locked ancestor folder. Only available while the active note is locked.
Import:
import { UnlockActiveNoteCommandHandler } from 'obsidian-dev-utils/obsidian/command-handlers/unlock-active-note-command-handler';Signature:
export class UnlockActiveNoteCommandHandler extends GlobalCommandHandlerExtends: GlobalCommandHandler
Constructor
new UnlockActiveNoteCommandHandler(params: UnlockActiveNoteCommandHandlerConstructorParams)Constructs a new instance.
Properties
| Property | Type | Description |
|---|---|---|
| app | App | The Obsidian app instance. |
| icon | IconName | The icon for the command. (Inherited from GlobalCommandHandler) |
| id | string | The ID of the command. (Inherited from GlobalCommandHandler) |
| name | string | The display name of the command. (Inherited from GlobalCommandHandler) |
| resourceLockComponent | ResourceLockComponent | The resource-lock component whose lock covering the active note the command releases. |
Methods
| Method | Returns | Description |
|---|---|---|
| buildCommand() | Command | Builds a plain Obsidian Command object with a checkCallback.(Inherited from GlobalCommandHandler) |
| canExecute() | boolean | Checks whether the command can currently execute: only when there is an active note covered by a lock (directly or by a subtree-locked ancestor folder). |
| execute() | void | Executes the command, unlocking the active note. |
| onRegistered(context) | Promise<void> | Called after the command has been registered with Obsidian. Subclasses use the provided context to register menu event handlers. (Inherited from GlobalCommandHandler) |
Links to this page: