From 155172a2b45a660822aa01e7aa69cd8e2f209a04 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 14 May 2025 00:49:33 +0300 Subject: [PATCH] Dynamically update show more title --- public/scripts/templates/welcomePanel.html | 2 +- public/scripts/welcome-screen.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/scripts/templates/welcomePanel.html b/public/scripts/templates/welcomePanel.html index f3a94c80b..69931c4c2 100644 --- a/public/scripts/templates/welcomePanel.html +++ b/public/scripts/templates/welcomePanel.html @@ -73,7 +73,7 @@ {{/with}} {{/each}} {{#if more}} - {{/if}} diff --git a/public/scripts/welcome-screen.js b/public/scripts/welcome-screen.js index e930a97e2..1c0792fb2 100644 --- a/public/scripts/welcome-screen.js +++ b/public/scripts/welcome-screen.js @@ -135,12 +135,17 @@ async function sendWelcomePanel() { }); const hiddenChats = fragment.querySelectorAll('.recentChat.hidden'); fragment.querySelectorAll('button.showMoreChats').forEach((button) => { + const showRecentChatsTitle = t`Show more recent chats`; + const hideRecentChatsTitle = t`Show less recent chats`; + + button.setAttribute('title', showRecentChatsTitle); button.addEventListener('click', () => { const rotate = button.classList.contains('rotated'); hiddenChats.forEach((chatItem) => { chatItem.classList.toggle('hidden', rotate); }); button.classList.toggle('rotated', !rotate); + button.setAttribute('title', rotate ? showRecentChatsTitle : hideRecentChatsTitle); }); }); fragment.querySelectorAll('button.openTemporaryChat').forEach((button) => {