fix(power): when restarting from the shutdown confirmation, skip the dialog

This commit is contained in:
Ashley Wulber 2024-05-16 19:32:28 -04:00 committed by Ashley Wulber
parent afff0793aa
commit 6ede0fbe05

View file

@ -172,7 +172,10 @@ impl cosmic::Application for Power {
}
Message::Action(action) => {
// Ask for user confirmation of non-destructive actions only
if matches!(action, PowerAction::Lock | PowerAction::Suspend) {
if matches!(action, PowerAction::Lock | PowerAction::Suspend)
|| matches!(action, PowerAction::Restart)
&& matches!(self.action_to_confirm, Some((_, PowerAction::Shutdown, _)))
{
action.perform()
} else {
let id = window::Id::unique();