Skip to content

unlockResourceForPath

Releases one lock previously acquired for the note at the given path via lockResourceForPath.

When the last lock is released the note becomes fully editable again and its lock indicators are removed. Calling this when the note is not locked is a no-op.

Import:

import { unlockResourceForPath } from 'obsidian-dev-utils/obsidian/resource-lock';

Signature:

function unlockResourceForPath(app: App, pathOrFile: PathOrFile, pluginId: string): void

Parameters:

ParameterTypeDescription
appAppThe Obsidian app instance.
pathOrFilePathOrFileThe path or file of the note to unlock.
pluginIdstringThe id of the plugin that holds the lock (e.g. its manifest.id); one of its locks on the note is released.

Returns: void


Links to this page: