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)
Changes
@@@ -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';@@@ -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>
@@ -86,7 +86,10 @@ function showAccountLoadError(err) {
@@ -86,7 +86,10 @@ function showAccountLoadError(err) {
if (nameEl) nameEl.textContent = "Couldn't load your account";
if (nameEl) nameEl.textContent = "Couldn't load your account";
if (subEl) {
if (subEl) {
const offline = (typeof navigator !== 'undefined' && navigator.onLine === false);
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');
const btn = document.createElement('button');
btn.type = 'button';
btn.type = 'button';
btn.className = 'acct-retry-btn';
btn.className = 'acct-retry-btn';
@@ -39,7 +39,7 @@
@@ -39,7 +39,7 @@
<div class="page">
<div class="page">
<div class="page-header" id="page-header">
<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">
<div class="info">
<h1 id="user-name">Loading...</h1>
<h1 id="user-name">Loading...</h1>
<div class="subtitle" id="user-subtitle"></div>
<div class="subtitle" id="user-subtitle"></div>