Skip to content

PluginNoticeComponent.showNoticeAfterDelay method

PluginNoticeComponent › showNoticeAfterDelay

Shows a notice describing a long-running operation, but only once the operation has run for longer than PluginNoticeComponentShowNoticeAfterDelayParams.delayInMilliseconds — so operations that finish sooner never flash a notice. The notice stays until the returned Disposable is disposed (which also cancels the pending timer if it has not fired yet), so it can be used with using. When an PluginNoticeComponentShowNoticeAfterDelayParams.abortController is given, a Cancel button that aborts it is appended (and, being interactive, does not dismiss the notice).

Signature:

showNoticeAfterDelay(params: PluginNoticeComponentShowNoticeAfterDelayParams): PluginNoticeComponentDelayedNotice

Parameters:

ParameterTypeDescription
paramsPluginNoticeComponentShowNoticeAfterDelayParamsThe parameters.

Returns: PluginNoticeComponentDelayedNoticeA PluginNoticeComponentDelayedNotice that hides the notice (or cancels the pending timer) when disposed and lets the content be updated while it is shown.

Example:

using _notice = pluginNoticeComponent.showNoticeAfterDelay({
abortController,
content: () => buildProgressFragment()
});
await runOperation(abortController.signal);