mirror of
https://github.com/RetroShare/RSNewWebUI.git
synced 2026-09-14 11:05:47 +05:00
Three defects in the new thread composer. The 199 000 limit of a GXS message is a *byte* count, but the composer compares it against String.length, which counts UTF-16 units: an accented letter is two bytes for one unit, an emoji four bytes for two. With an emoji picker one click away in that very toolbar, the counter can report room left on a message the core will refuse. It now measures UTF-8 through TextEncoder, and says bytes rather than characters. postBody() was called five times per render -- twice for the class, twice for the counter text, once for the disabled state -- and it re-escapes the message and re-joins every inline image, each of which is up to 175 KB of base64. That ran on every global redraw, which the statusbar triggers continuously, while the user is typing. It is now built once per pass. pollFileHash() re-arms itself every 500 ms for up to a minute. Closing the composer left it running: it kept polling and redrawing a component that is no longer mounted. onremove now stops it. |
||
|---|---|---|
| .. | ||
| forum_view.js | ||
| forums_util.js | ||
| forums.js | ||
| my_forums.js | ||
| other_forums.js | ||
| popular_forums.js | ||
| subscribed_forums.js | ||