openvibers/openvibe.network Commits

Account page error state: no "Profile avatar" text spilling from the empty avatar, and a 429 says too many requests instead of "Request failed" (#277)

OP OpenVibers committed 27 days ago · 28194993be · 2 files, +5 −2

Changes

ddiff --git a/public/js/my/profile.js b/public/js/my/profile.js
iindex 3757f945..80e3de7f 100644
---- a/public/js/my/profile.js
++++ b/public/js/my/profile.js
@@@ -86,7 +86,10 @@ function showAccountLoadError(err) {
if (nameEl) nameEl.textContent = "Couldn't load your account";
if (subEl) {
const offline = (typeof navigator !== 'undefined' && navigator.onLine === false);
-- subEl.textContent = (offline ? "You appear to be offline" : (err && err.message) ? err.message : 'Something went wrong') + ' · ';
++ const why = offline ? 'You appear to be offline'
++ : err && err.status === 429 ? 'Too many requests from this connection; try again in a minute'
++ : (err && err.message) || 'Something went wrong';
++ subEl.textContent = why + ' · ';
const btn = document.createElement('button');
btn.type = 'button';
btn.className = 'acct-retry-btn';
ddiff --git a/public/my.html b/public/my.html
iindex 117a6f1b..b72621cd 100644
---- a/public/my.html
++++ b/public/my.html
@@@ -39,7 +39,7 @@
<div class="page">
<div class="page-header" id="page-header">
-- <img class="avatar" id="user-avatar" src="" alt="Profile avatar">
++ <img class="avatar" id="user-avatar" src="" alt="">
<div class="info">
<h1 id="user-name">Loading...</h1>
<div class="subtitle" id="user-subtitle"></div>