File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
modules/yup_data_model/undo Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,14 @@ bool UndoManager::perform (UndoableAction::Ptr action)
135135 if (! isEnabled ())
136136 return false ;
137137
138+ // Ensure timer is started if MessageManager is now available and we're enabled
139+ if (actionGroupThreshold > RelativeTime ()
140+ && ! isTimerRunning ()
141+ && MessageManager::getInstanceWithoutCreating () != nullptr )
142+ {
143+ startTimer (static_cast <int > (actionGroupThreshold.inMilliseconds ()));
144+ }
145+
138146 if (action->perform (UndoableActionState::Redo))
139147 {
140148 if (currentTransaction == nullptr )
@@ -248,7 +256,8 @@ void UndoManager::setEnabled (bool shouldBeEnabled)
248256
249257 if (shouldBeEnabled)
250258 {
251- if (actionGroupThreshold > RelativeTime ())
259+ // Only start timer if MessageManager exists (may not be available during early initialization)
260+ if (actionGroupThreshold > RelativeTime () && MessageManager::getInstanceWithoutCreating () != nullptr )
252261 startTimer (static_cast <int > (actionGroupThreshold.inMilliseconds ()));
253262 }
254263 else
You can’t perform that action at this time.
0 commit comments