feat(post-page): enable Update button to refresh replies, add Auto alert translation

Update button calls useReplies().reset() for manual refresh. Auto button
shows translated informational alert. Register reply feed reset in Post
desktop/mobile when on post page.
This commit is contained in:
plebeius
2026-02-12 17:44:26 +08:00
parent 378242cdde
commit ad41a78974
39 changed files with 102 additions and 60 deletions
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "في انتظار موافقة المشرف، غير مرئي للمستخدمين", "pending_mod_approval": "في انتظار موافقة المشرف، غير مرئي للمستخدمين",
"copy_user_id": "نسخ معرف المستخدم", "copy_user_id": "نسخ معرف المستخدم",
"copy_direct_link": "نسخ الرابط المباشر" "copy_direct_link": "نسخ الرابط المباشر",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "মডারেটর অনুমোদনের জন্য অপেক্ষা করছে, ব্যবহারকারীদের কাছে দৃশ্যমান নয়", "pending_mod_approval": "মডারেটর অনুমোদনের জন্য অপেক্ষা করছে, ব্যবহারকারীদের কাছে দৃশ্যমান নয়",
"copy_user_id": "ইউজার আইডি কপি করুন", "copy_user_id": "ইউজার আইডি কপি করুন",
"copy_direct_link": "সরাসরি লিংক অনুলিপি করুন" "copy_direct_link": "সরাসরি লিংক অনুলিপি করুন",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Čekání na schválení moderatorem, není viditelné uživatelům", "pending_mod_approval": "Čekání na schválení moderatorem, není viditelné uživatelům",
"copy_user_id": "kopírovat ID uživatele", "copy_user_id": "kopírovat ID uživatele",
"copy_direct_link": "kopírovat přímý odkaz" "copy_direct_link": "kopírovat přímý odkaz",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Afventer moderatorgodkendelse, ikke synlig for brugere", "pending_mod_approval": "Afventer moderatorgodkendelse, ikke synlig for brugere",
"copy_user_id": "kopier bruger-ID", "copy_user_id": "kopier bruger-ID",
"copy_direct_link": "kopier direkte link" "copy_direct_link": "kopier direkte link",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "Nein", "no": "Nein",
"pending_mod_approval": "Ausstehende Moderatorgenehmigung, für Benutzer nicht sichtbar", "pending_mod_approval": "Ausstehende Moderatorgenehmigung, für Benutzer nicht sichtbar",
"copy_user_id": "Benutzer-ID kopieren", "copy_user_id": "Benutzer-ID kopieren",
"copy_direct_link": "Direktlink kopieren" "copy_direct_link": "Direktlink kopieren",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Σε αναμονή έγκρισης διαχειριστή, δεν είναι ορατό στους χρήστες", "pending_mod_approval": "Σε αναμονή έγκρισης διαχειριστή, δεν είναι ορατό στους χρήστες",
"copy_user_id": "αντιγραφή ID χρήστη", "copy_user_id": "αντιγραφή ID χρήστη",
"copy_direct_link": "αντιγραφή άμεσου συνδέσμου" "copy_direct_link": "αντιγραφή άμεσου συνδέσμου",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+1
View File
@@ -70,6 +70,7 @@
"latest_stable_version": "You are on the latest stable version, 5chan v{{version}}.", "latest_stable_version": "You are on the latest stable version, 5chan v{{version}}.",
"check": "check", "check": "check",
"update": "Update", "update": "Update",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment.",
"style": "Style", "style": "Style",
"interface_language": "interface language", "interface_language": "interface language",
"delete_confirm": "Are you sure you want to delete {{value}}?", "delete_confirm": "Are you sure you want to delete {{value}}?",
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Pendiente de aprobación del moderador, no visible para los usuarios", "pending_mod_approval": "Pendiente de aprobación del moderador, no visible para los usuarios",
"copy_user_id": "Copiar ID de usuario", "copy_user_id": "Copiar ID de usuario",
"copy_direct_link": "Copiar enlace directo" "copy_direct_link": "Copiar enlace directo",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "در انتظار تایید مدیر، برای کاربران قابل مشاهده نیست", "pending_mod_approval": "در انتظار تایید مدیر، برای کاربران قابل مشاهده نیست",
"copy_user_id": "کپی شناسه کاربر", "copy_user_id": "کپی شناسه کاربر",
"copy_direct_link": "رونوشت لینک مستقیم" "copy_direct_link": "رونوشت لینک مستقیم",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Odottaa moderaattorin hyväksyntää, ei näkyvissä käyttäjille", "pending_mod_approval": "Odottaa moderaattorin hyväksyntää, ei näkyvissä käyttäjille",
"copy_user_id": "kopioi käyttäjätunnus", "copy_user_id": "kopioi käyttäjätunnus",
"copy_direct_link": "kopioi suora linkki" "copy_direct_link": "kopioi suora linkki",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Naghihintay ng pag-apruba ng moderator, hindi nakikita ng mga gumagamit", "pending_mod_approval": "Naghihintay ng pag-apruba ng moderator, hindi nakikita ng mga gumagamit",
"copy_user_id": "kopyahin ang user ID", "copy_user_id": "kopyahin ang user ID",
"copy_direct_link": "kopyahin ang direct link" "copy_direct_link": "kopyahin ang direct link",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "Non", "no": "Non",
"pending_mod_approval": "En attente d'approbation du modérateur, non visible pour les utilisateurs", "pending_mod_approval": "En attente d'approbation du modérateur, non visible pour les utilisateurs",
"copy_user_id": "Copier l'ID utilisateur", "copy_user_id": "Copier l'ID utilisateur",
"copy_direct_link": "Copier le lien direct" "copy_direct_link": "Copier le lien direct",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "ממתין לאישור מנהל, לא ניתן לראות למשתמשים", "pending_mod_approval": "ממתין לאישור מנהל, לא ניתן לראות למשתמשים",
"copy_user_id": "העתק מזהה משתמש", "copy_user_id": "העתק מזהה משתמש",
"copy_direct_link": "העתק קישור ישיר" "copy_direct_link": "העתק קישור ישיר",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "मॉडरेटर की मंजूरी के लिए प्रतीक्षा में, उपयोगकर्ताओं को दिखाई नहीं देता", "pending_mod_approval": "मॉडरेटर की मंजूरी के लिए प्रतीक्षा में, उपयोगकर्ताओं को दिखाई नहीं देता",
"copy_user_id": "यूज़र ID कॉपी करें", "copy_user_id": "यूज़र ID कॉपी करें",
"copy_direct_link": "डायरेक्ट लिंक कॉपी करें" "copy_direct_link": "डायरेक्ट लिंक कॉपी करें",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Moderátor jóváhagyása alatt áll, a felhasználók számára nem látható", "pending_mod_approval": "Moderátor jóváhagyása alatt áll, a felhasználók számára nem látható",
"copy_user_id": "felhasználói ID másolása", "copy_user_id": "felhasználói ID másolása",
"copy_direct_link": "közvetlen link másolása" "copy_direct_link": "közvetlen link másolása",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Menunggu persetujuan moderator, tidak terlihat oleh pengguna", "pending_mod_approval": "Menunggu persetujuan moderator, tidak terlihat oleh pengguna",
"copy_user_id": "salin ID pengguna", "copy_user_id": "salin ID pengguna",
"copy_direct_link": "salin tautan langsung" "copy_direct_link": "salin tautan langsung",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "In attesa di approvazione del moderatore, non visibile agli utenti", "pending_mod_approval": "In attesa di approvazione del moderatore, non visibile agli utenti",
"copy_user_id": "Copia ID utente", "copy_user_id": "Copia ID utente",
"copy_direct_link": "Copia link diretto" "copy_direct_link": "Copia link diretto",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "いいえ", "no": "いいえ",
"pending_mod_approval": "モデレーターの承認待ち、ユーザーには表示されません", "pending_mod_approval": "モデレーターの承認待ち、ユーザーには表示されません",
"copy_user_id": "ユーザーIDをコピー", "copy_user_id": "ユーザーIDをコピー",
"copy_direct_link": "直接リンクをコピー" "copy_direct_link": "直接リンクをコピー",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "중재자 승인 대기 중, 사용자에게 표시되지 않음", "pending_mod_approval": "중재자 승인 대기 중, 사용자에게 표시되지 않음",
"copy_user_id": "사용자 ID 복사", "copy_user_id": "사용자 ID 복사",
"copy_direct_link": "직접 링크 복사" "copy_direct_link": "직접 링크 복사",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "संचालकाच्या मंजुरीची प्रतीक्षा, वापरकर्त्यांना दिसत नाही", "pending_mod_approval": "संचालकाच्या मंजुरीची प्रतीक्षा, वापरकर्त्यांना दिसत नाही",
"copy_user_id": "यूजर ID कॉपी करा", "copy_user_id": "यूजर ID कॉपी करा",
"copy_direct_link": "डायरेक्ट लिंक कॉपी करा" "copy_direct_link": "डायरेक्ट लिंक कॉपी करा",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "In afwachting van moderatorgoedkeuring, niet zichtbaar voor gebruikers", "pending_mod_approval": "In afwachting van moderatorgoedkeuring, niet zichtbaar voor gebruikers",
"copy_user_id": "gebruikers-ID kopiëren", "copy_user_id": "gebruikers-ID kopiëren",
"copy_direct_link": "directe link kopiëren" "copy_direct_link": "directe link kopiëren",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Venter på moderatorgodkjenning, ikke synlig for brukere", "pending_mod_approval": "Venter på moderatorgodkjenning, ikke synlig for brukere",
"copy_user_id": "kopier bruker-ID", "copy_user_id": "kopier bruker-ID",
"copy_direct_link": "kopier direkte lenke" "copy_direct_link": "kopier direkte lenke",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Oczekiwanie na zatwierdzenie moderatora, niewidoczne dla użytkowników", "pending_mod_approval": "Oczekiwanie na zatwierdzenie moderatora, niewidoczne dla użytkowników",
"copy_user_id": "skopiuj ID użytkownika", "copy_user_id": "skopiuj ID użytkownika",
"copy_direct_link": "skopiuj bezpośredni link" "copy_direct_link": "skopiuj bezpośredni link",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "Não", "no": "Não",
"pending_mod_approval": "Aguardando aprovação do moderador, não visível para os usuários", "pending_mod_approval": "Aguardando aprovação do moderador, não visível para os usuários",
"copy_user_id": "Copiar ID do usuário", "copy_user_id": "Copiar ID do usuário",
"copy_direct_link": "Copiar link direto" "copy_direct_link": "Copiar link direto",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "În așteptarea aprobării moderatorului, nu este vizibil pentru utilizatori", "pending_mod_approval": "În așteptarea aprobării moderatorului, nu este vizibil pentru utilizatori",
"copy_user_id": "copiați ID-ul utilizatorului", "copy_user_id": "copiați ID-ul utilizatorului",
"copy_direct_link": "copiați linkul direct" "copy_direct_link": "copiați linkul direct",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "Нет", "no": "Нет",
"pending_mod_approval": "Ожидает одобрения модератора, не видно пользователям", "pending_mod_approval": "Ожидает одобрения модератора, не видно пользователям",
"copy_user_id": "копировать ID пользователя", "copy_user_id": "копировать ID пользователя",
"copy_direct_link": "копировать прямую ссылку" "copy_direct_link": "копировать прямую ссылку",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Duke pritur miratimin e moderatorit, jo i dukshëm për përdoruesit", "pending_mod_approval": "Duke pritur miratimin e moderatorit, jo i dukshëm për përdoruesit",
"copy_user_id": "kopjo ID e përdoruesit", "copy_user_id": "kopjo ID e përdoruesit",
"copy_direct_link": "kopjo lidhjen e drejtpërdrejtë" "copy_direct_link": "kopjo lidhjen e drejtpërdrejtë",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Väntar på moderatorgodkännande, inte synligt för användare", "pending_mod_approval": "Väntar på moderatorgodkännande, inte synligt för användare",
"copy_user_id": "kopiera användar-ID", "copy_user_id": "kopiera användar-ID",
"copy_direct_link": "kopiera direktlänk" "copy_direct_link": "kopiera direktlänk",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "మాడరేటర్ ఆమోదం కోసం చేతనిస్తోంది, వినియోగదారులకు కనిపించవు", "pending_mod_approval": "మాడరేటర్ ఆమోదం కోసం చేతనిస్తోంది, వినియోగదారులకు కనిపించవు",
"copy_user_id": "యూజర్ ID కాపీ చేయండి", "copy_user_id": "యూజర్ ID కాపీ చేయండి",
"copy_direct_link": "డైరెక్ట్ లింక్ కాపీ చేయండి" "copy_direct_link": "డైరెక్ట్ లింక్ కాపీ చేయండి",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "รอการอนุมัติจากผู้ดูแล ไม่มองเห็นสำหรับผู้ใช้", "pending_mod_approval": "รอการอนุมัติจากผู้ดูแล ไม่มองเห็นสำหรับผู้ใช้",
"copy_user_id": "คัดลอก ID ผู้ใช้", "copy_user_id": "คัดลอก ID ผู้ใช้",
"copy_direct_link": "คัดลอกลิงก์โดยตรง" "copy_direct_link": "คัดลอกลิงก์โดยตรง",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Moderatör onayı beklemede, kullanıcılara görünmüyor", "pending_mod_approval": "Moderatör onayı beklemede, kullanıcılara görünmüyor",
"copy_user_id": "kullanıcı ID'sini kopyala", "copy_user_id": "kullanıcı ID'sini kopyala",
"copy_direct_link": "doğrudan bağlantıyı kopyala" "copy_direct_link": "doğrudan bağlantıyı kopyala",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Очікує затвердження модератора, не видно користувачам", "pending_mod_approval": "Очікує затвердження модератора, не видно користувачам",
"copy_user_id": "копіювати ID користувача", "copy_user_id": "копіювати ID користувача",
"copy_direct_link": "копіювати пряме посилання" "copy_direct_link": "копіювати пряме посилання",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "ماڈریٹر کی منظوری کا انتظار، صارفین کے لیے نظر نہیں آتا", "pending_mod_approval": "ماڈریٹر کی منظوری کا انتظار، صارفین کے لیے نظر نہیں آتا",
"copy_user_id": "صارف کی شناخت کاپی کریں", "copy_user_id": "صارف کی شناخت کاپی کریں",
"copy_direct_link": "براہ راست لنک کاپی کریں" "copy_direct_link": "براہ راست لنک کاپی کریں",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "No", "no": "No",
"pending_mod_approval": "Chờ duyệt của người điều hành, không hiển thị cho người dùng", "pending_mod_approval": "Chờ duyệt của người điều hành, không hiển thị cho người dùng",
"copy_user_id": "sao chép ID người dùng", "copy_user_id": "sao chép ID người dùng",
"copy_direct_link": "sao chép liên kết trực tiếp" "copy_direct_link": "sao chép liên kết trực tiếp",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+2 -1
View File
@@ -277,5 +277,6 @@
"no": "否", "no": "否",
"pending_mod_approval": "等待版主批准,用户不可见", "pending_mod_approval": "等待版主批准,用户不可见",
"copy_user_id": "复制用户ID", "copy_user_id": "复制用户ID",
"copy_direct_link": "复制直接链接" "copy_direct_link": "复制直接链接",
"posts_auto_update_info": "Posts update automatically every ~2 minutes. It's not possible to disable this at the moment."
} }
+1 -1
View File
@@ -102,7 +102,7 @@ const htmlSection = section('Static HTML build', [htmlZip && `- 5chan-html (zip)
const downloads = [macSection, winSection, linuxSection, androidSection, htmlSection].filter(Boolean).join('\n\n'); const downloads = [macSection, winSection, linuxSection, androidSection, htmlSection].filter(Boolean).join('\n\n');
// One-liner summary of what changed in this release. Update before each release. // One-liner summary of what changed in this release. Update before each release.
const oneLinerDescription = 'This version adds backlinks for quoted posts, improves reply functionality with proper quote references, and includes several bug fixes.'; const oneLinerDescription = 'This version enables the Update button on the post page to refresh replies, adds an informational alert for the Auto checkbox, fixes inline quote link layout, and includes several bug fixes.';
const releaseBody = `${oneLinerDescription} const releaseBody = `${oneLinerDescription}
+8 -23
View File
@@ -147,47 +147,32 @@ const RefreshButton = () => {
const UpdateButton = () => { const UpdateButton = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const isMobile = useIsMobile(); const reset = useFeedResetStore((state) => state.reset);
const handleManualUpdate = () => {
window.alert('Manual updates are not available yet. Posts update automatically every ~2 minutes.');
};
return ( return (
<> <button className='button' onClick={() => reset?.()}>
{/* TODO: Implement update button once available in API */} {t('update')}
{isMobile ? ( </button>
<button className={`button ${styles.disabledButton}`} onClick={handleManualUpdate}>
{t('update')}
</button>
) : (
<button className={`button ${styles.disabledButton}`} onClick={handleManualUpdate}>
{t('update')}
</button>
)}
</>
); );
}; };
const AutoButton = () => { const AutoButton = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const handleAutoClick = () => {
const handleManualUpdate = () => { window.alert(t('posts_auto_update_info'));
window.alert('Manual updates are not available yet. Posts update automatically every ~2 minutes.');
}; };
return ( return (
<> <>
{isMobile ? ( {isMobile ? (
<button className='button' onClick={handleManualUpdate}> <button className='button' onClick={handleAutoClick}>
<label> <label>
<input type='checkbox' className={styles.autoCheckbox} checked disabled /> <input type='checkbox' className={styles.autoCheckbox} checked disabled />
{t('Auto')} {t('Auto')}
</label> </label>
</button> </button>
) : ( ) : (
<label onClick={handleManualUpdate}> <label onClick={handleAutoClick}>
{' '} {' '}
<input type='checkbox' className={styles.autoCheckbox} checked disabled /> {t('Auto')} <input type='checkbox' className={styles.autoCheckbox} checked disabled /> {t('Auto')}
</label> </label>
+12 -1
View File
@@ -38,6 +38,7 @@ import { shouldShowSnow } from '../../lib/snow';
import useReplyModalStore from '../../stores/use-reply-modal-store'; import useReplyModalStore from '../../stores/use-reply-modal-store';
import { selectPostMenuProps } from '../../lib/utils/post-menu-props'; import { selectPostMenuProps } from '../../lib/utils/post-menu-props';
import useChallengesStore from '../../stores/use-challenges-store'; import useChallengesStore from '../../stores/use-challenges-store';
import useFeedResetStore from '../../stores/use-feed-reset-store';
import usePostNumberStore from '../../stores/use-post-number-store'; import usePostNumberStore from '../../stores/use-post-number-store';
import { alertChallengeVerificationFailed } from '../../lib/utils/challenge-utils'; import { alertChallengeVerificationFailed } from '../../lib/utils/challenge-utils';
import { usePublishCommentModeration } from '@plebbit/plebbit-react-hooks'; import { usePublishCommentModeration } from '@plebbit/plebbit-react-hooks';
@@ -626,7 +627,17 @@ const PostDesktop = ({
const { hidden, unhide, hide } = useHide({ cid }); const { hidden, unhide, hide } = useHide({ cid });
const isHidden = hidden && !isInPostPageView; const isHidden = hidden && !isInPostPageView;
const { replies, hasMore, loadMore } = useReplies({ comment: post, flat: true, accountComments: { newerThan: Infinity } }); const repliesResult = useReplies({ comment: post, flat: true, accountComments: { newerThan: Infinity } });
const { replies, hasMore, loadMore } = repliesResult;
const reset = (repliesResult as { reset?: () => Promise<void> }).reset;
const setResetFunction = useFeedResetStore((s) => s.setResetFunction);
useEffect(() => {
if ((isInPostPageView || isInPendingPostView) && reset) {
setResetFunction(() => {
reset();
});
}
}, [isInPostPageView, isInPendingPostView, reset, setResetFunction]);
const registerComments = usePostNumberStore((s) => s.registerComments); const registerComments = usePostNumberStore((s) => s.registerComments);
const numberToCid = usePostNumberStore((s) => s.numberToCid); const numberToCid = usePostNumberStore((s) => s.numberToCid);
const prevCidsRef = useRef<string>(''); const prevCidsRef = useRef<string>('');
+12 -1
View File
@@ -34,6 +34,7 @@ import { capitalize, lowerCase } from 'lodash';
import useReplyModalStore from '../../stores/use-reply-modal-store'; import useReplyModalStore from '../../stores/use-reply-modal-store';
import { selectPostMenuProps } from '../../lib/utils/post-menu-props'; import { selectPostMenuProps } from '../../lib/utils/post-menu-props';
import useChallengesStore from '../../stores/use-challenges-store'; import useChallengesStore from '../../stores/use-challenges-store';
import useFeedResetStore from '../../stores/use-feed-reset-store';
import usePostNumberStore from '../../stores/use-post-number-store'; import usePostNumberStore from '../../stores/use-post-number-store';
import { alertChallengeVerificationFailed } from '../../lib/utils/challenge-utils'; import { alertChallengeVerificationFailed } from '../../lib/utils/challenge-utils';
@@ -476,7 +477,17 @@ const PostMobile = ({
const directories = useDirectories(); const directories = useDirectories();
const boardPath = subplebbitAddress ? getBoardPath(subplebbitAddress, directories) : undefined; const boardPath = subplebbitAddress ? getBoardPath(subplebbitAddress, directories) : undefined;
const linksCount = useCountLinksInReplies(post); const linksCount = useCountLinksInReplies(post);
const { replies, hasMore, loadMore } = useReplies({ comment: post, accountComments: { newerThan: Infinity } }); const repliesResult = useReplies({ comment: post, accountComments: { newerThan: Infinity } });
const { replies, hasMore, loadMore } = repliesResult;
const reset = (repliesResult as { reset?: () => Promise<void> }).reset;
const setResetFunction = useFeedResetStore((s) => s.setResetFunction);
useEffect(() => {
if ((isInPostView || isInPendingPostView) && reset) {
setResetFunction(() => {
reset();
});
}
}, [isInPostView, isInPendingPostView, reset, setResetFunction]);
const registerComments = usePostNumberStore((s) => s.registerComments); const registerComments = usePostNumberStore((s) => s.registerComments);
const numberToCid = usePostNumberStore((s) => s.numberToCid); const numberToCid = usePostNumberStore((s) => s.numberToCid);
const prevCidsRef = useRef<string>(''); const prevCidsRef = useRef<string>('');