Skip to content

Commit

Permalink
Fixed add reaction from expanded menu
Browse files Browse the repository at this point in the history
  • Loading branch information
FrayxRulez committed Aug 12, 2023
1 parent 0a86dc8 commit eeec74e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 27 deletions.
20 changes: 6 additions & 14 deletions Telegram/Controls/Messages/EmojiMenuFlyout.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,13 @@ private void OnStatusClick(object sender, ItemClickEventArgs e)
{
_popup.IsOpen = false;

if (_message != null)
if (_story != null)
{
ToggleReaction(sticker.ToReactionType());
StoryToggleReaction(sticker.ToReactionType());
}
else if (_message != null)
{
MessageToggleReaction(sticker.ToReactionType());
}
else if (_mode == EmojiDrawerMode.CustomEmojis && sticker.FullType is StickerFullTypeCustomEmoji customEmoji)
{
Expand Down Expand Up @@ -485,18 +489,6 @@ private async void ChooseStatus(Sticker sticker)
}
}

private void ToggleReaction(ReactionType reaction)
{
if (_story != null)
{
StoryToggleReaction(reaction);
}
else if (_message != null)
{
MessageToggleReaction(reaction);
}
}

private async void StoryToggleReaction(ReactionType reaction)
{
if (_story.ChosenReactionType != null && _story.ChosenReactionType.AreTheSame(reaction))
Expand Down
21 changes: 8 additions & 13 deletions Telegram/Controls/Messages/ReactionsMenuFlyout.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,19 +330,14 @@ private void Reaction_Click(object sender, RoutedEventArgs e)

if (sender is HyperlinkButton button && button.Tag is ReactionType reaction)
{
ToggleReaction(reaction);
}
}

private void ToggleReaction(ReactionType reaction)
{
if (_story != null)
{
StoryToggleReaction(reaction);
}
else if (_message != null)
{
MessageToggleReaction(reaction);
if (_story != null)
{
StoryToggleReaction(reaction);
}
else if (_message != null)
{
MessageToggleReaction(reaction);
}
}
}

Expand Down

0 comments on commit eeec74e

Please sign in to comment.