Dynamically update show more title

This commit is contained in:
Cohee
2025-05-14 00:49:33 +03:00
parent dfbc5ec4ac
commit 155172a2b4
2 changed files with 6 additions and 1 deletions

View File

@@ -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) => {