From 2ae4e15f87f4124c86ccf9a0423320a72685b817 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 21 Nov 2024 14:30:21 +0300 Subject: [PATCH] Fixed ability to copy transactions id from credits history entries. Regression was introduced in 77e7796b3f. --- .../SourceFiles/boxes/gift_premium_box.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Telegram/SourceFiles/boxes/gift_premium_box.cpp b/Telegram/SourceFiles/boxes/gift_premium_box.cpp index 78c74ffeb1d473..54218965978def 100644 --- a/Telegram/SourceFiles/boxes/gift_premium_box.cpp +++ b/Telegram/SourceFiles/boxes/gift_premium_box.cpp @@ -1255,24 +1255,12 @@ void AddCreditsHistoryEntryTable( Ui::Text::WithEntities)); } if (!entry.id.isEmpty()) { - constexpr auto kOneLineCount = 22; - const auto oneLine = entry.id.size() <= kOneLineCount; - auto multiLine = QString(); - if (!oneLine) { - for (auto i = 0; i < entry.id.size(); ++i) { - multiLine.append(entry.id[i]); - if ((i + 1) % kOneLineCount == 0) { - multiLine.append('\n'); - } - } - } + constexpr auto kOneLineCount = 24; + const auto oneLine = entry.id.length() <= kOneLineCount; auto label = object_ptr( table, rpl::single( - Ui::Text::Wrapped( - { oneLine ? entry.id : std::move(multiLine) }, - EntityType::Code, - {})), + Ui::Text::Wrapped({ entry.id }, EntityType::Code, {})), oneLine ? st::giveawayGiftCodeValue : st::giveawayGiftCodeValueMultiline);