From b99f45cba818a9d483fb58e9b31de5dee799e315 Mon Sep 17 00:00:00 2001 From: Francis Feng Date: Sat, 22 Jul 2023 17:35:39 +0800 Subject: [PATCH] Fix `animated: false` not working (#105) --- .../Settings/SettingsTabViewController.swift | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Sources/Settings/SettingsTabViewController.swift b/Sources/Settings/SettingsTabViewController.swift index 778175a..2ca0247 100644 --- a/Sources/Settings/SettingsTabViewController.swift +++ b/Sources/Settings/SettingsTabViewController.swift @@ -154,16 +154,15 @@ final class SettingsTabViewController: NSViewController, SettingsStyleController options: NSViewController.TransitionOptions = [], completionHandler completion: (() -> Void)? = nil ) { - let isAnimated = options - .isSubset(of: [ - .crossfade, - .slideUp, - .slideDown, - .slideForward, - .slideBackward, - .slideLeft, - .slideRight - ]) + let isAnimated = !options.isEmpty && options.isSubset(of: [ + .crossfade, + .slideUp, + .slideDown, + .slideForward, + .slideBackward, + .slideLeft, + .slideRight + ]) if isAnimated { NSAnimationContext.runAnimationGroup({ context in