Skip to content

Commit

Permalink
docs: minor changes to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoEllet authored Jan 10, 2025
1 parent 284ab26 commit 420a629
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/toolbar/buttons/clipboard_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,23 @@ class QuillToolbarClipboardButtonState
void didUpdateWidget(QuillToolbarClipboardButton oldWidget) {
super.didUpdateWidget(oldWidget);

// Default didUpdateWidget handler, otherwise simple flag change didn't stop the monitor
// Default didUpdateWidget handler, otherwise simple flag change didn't stop the monitor.
if (oldWidget.controller != controller) {
oldWidget.controller.removeListener(didChangeEditingValue);
removeExtraListener(oldWidget);
controller.addListener(didChangeEditingValue);
addExtraListener();
currentValue = currentStateValue;
}
// If controller didn't change, but something else did (enableClipboardPaste)
// The controller didn't change, but enableClipboardPaste did.
else if (widget.clipboardAction == ClipboardAction.paste) {
// If enableClipboardPaste is null, check if clipboard monitor is active and enable it if not
// Check if the clipboard monitor is active and enable it if not.
if (widget.options.enableClipboardPaste == null) {
if (!(_monitor._timer?.isActive ?? false)) {
_monitor.monitorClipboard(true, _listenClipboardStatus);
}
} else {
// Otherwise check if the timer is active and disable it
// Otherwise check if the timer is active and disable it.
if (_monitor._timer == null || _monitor._timer!.isActive) {
_monitor.monitorClipboard(false, _listenClipboardStatus);
}
Expand Down

0 comments on commit 420a629

Please sign in to comment.