Skip to content

Commit

Permalink
Fix one time media
Browse files Browse the repository at this point in the history
  • Loading branch information
FrayxRulez committed Nov 10, 2024
1 parent 3202215 commit 77af6f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Telegram/Controls/Gallery/GalleryWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,10 @@ protected override void OnBackRequestedOverride(object sender, BackRequestedRout
var root = LayoutRoot.CurrentElement;
if (root != null && root.IsLoaded && IsConstrainedToRootBounds && !_lastFullScreen)
{
var animation = ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("FullScreenPicture", root);
if (animation != null)
if (_closing.TryGetTarget(out FrameworkElement element) && element.IsConnected())
{
if (_closing.TryGetTarget(out FrameworkElement element) && element.IsConnected())
var animation = ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("FullScreenPicture", root);
if (animation != null)
{
void handler(ConnectedAnimation s, object e)
{
Expand Down
3 changes: 2 additions & 1 deletion Telegram/ViewModels/Gallery/GalleryMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public partial class GalleryMessage : GalleryMedia
public GalleryMessage(IClientService clientService, Message message)
: base(clientService)
{
_message = message;
// Create a copy so that content doesn't get updated while the gallery is open
_message = new(message.Id, message.SenderId, message.ChatId, message.SendingState, message.SchedulingState, message.IsOutgoing, message.IsPinned, message.IsFromOffline, message.CanBeSaved, message.HasTimestampedMedia, message.IsChannelPost, message.IsTopicMessage, message.ContainsUnreadMention, message.Date, message.EditDate, message.ForwardInfo, message.ImportInfo, message.InteractionInfo, message.UnreadReactions, message.FactCheck, message.ReplyTo, message.MessageThreadId, message.SavedMessagesTopicId, message.SelfDestructType, message.SelfDestructIn, message.AutoDeleteIn, message.ViaBotUserId, message.SenderBusinessBotUserId, message.SenderBoostCount, message.AuthorSignature, message.MediaAlbumId, message.EffectId, message.HasSensitiveContent, message.RestrictionReason, message.Content, message.ReplyMarkup);

if (clientService.TryGetChat(message.ChatId, out Chat chat))
{
Expand Down

0 comments on commit 77af6f9

Please sign in to comment.