diff --git a/Telegram/SourceFiles/platform/mac/touchbar.h b/Telegram/SourceFiles/platform/mac/touchbar.h
index dec5806c6..9f3311d34 100644
--- a/Telegram/SourceFiles/platform/mac/touchbar.h
+++ b/Telegram/SourceFiles/platform/mac/touchbar.h
@@ -36,6 +36,7 @@ static NSTouchBarItemIdentifier _Nullable currentPosition = [NSString stringWith
 
 @interface TouchBar : NSTouchBar
 @property TouchBarType touchBarType;
+@property TouchBarType touchBarTypeBeforeLock;
 
 @property(retain) NSDictionary * _Nullable touchbarItems;
 @property(retain) NSTouchBar * _Nullable touchBarMain;
diff --git a/Telegram/SourceFiles/platform/mac/touchbar.mm b/Telegram/SourceFiles/platform/mac/touchbar.mm
index d42601138..065b5821e 100644
--- a/Telegram/SourceFiles/platform/mac/touchbar.mm
+++ b/Telegram/SourceFiles/platform/mac/touchbar.mm
@@ -268,6 +268,16 @@ auto lifetime = rpl::lifetime();
 		}
 	}, lifetime);
 	
+	Core::App().passcodeLockChanges(
+	) | rpl::start_with_next([=](bool locked) {
+		if (locked) {
+			self.touchBarTypeBeforeLock = self.touchBarType;
+			[self setTouchBar:TouchBarType::None];
+		} else {
+			[self setTouchBar:self.touchBarTypeBeforeLock];
+		}
+	}, lifetime);
+	
 	return self;
 }
 
@@ -341,6 +351,8 @@ auto lifetime = rpl::lifetime();
 		[self.view setTouchBar:_touchBarMain];
 	} else if (type == TouchBarType::AudioPlayer) {
 		[self.view setTouchBar:_touchBarAudioPlayer];
+	} else if (type == TouchBarType::None) {
+		[self.view setTouchBar:nil];
 	}
 }