Fix mobile topbar avatar: populate self picture
renderMobileTopbar read global.__OASIS_SELF_AVATAR__, but nothing ever set it, so the top-right circle always fell back to the default avatar (noticeable in the start/welcome flow, where the profile card showed the real picture but the topbar circle did not). Populate the global in the throttled refresh middleware from about.image(self): build /image/256/<blob> when a picture exists, else leave it null so the topbar uses the default avatar.
This commit is contained in:
parent
230d11ba7a
commit
8ab1cf6d18
1 changed files with 13 additions and 0 deletions
|
|
@ -8601,6 +8601,19 @@ const middleware = [
|
|||
const now = Date.now();
|
||||
if (now - sharedState.getLastRefresh() > 60000) {
|
||||
sharedState.setLastRefresh(now);
|
||||
try {
|
||||
// avatar propio para el círculo del topbar móvil (lo lee renderMobileTopbar)
|
||||
const meId = getViewerId();
|
||||
const selfImg = meId ? await about.image(meId) : null;
|
||||
const NULL_IMG = '&' + '0'.repeat(43) + '=.sha256';
|
||||
if (typeof selfImg === 'string' && selfImg[0] === '&' && selfImg !== NULL_IMG) {
|
||||
global.__OASIS_SELF_AVATAR__ = `/image/256/${encodeURIComponent(selfImg)}`;
|
||||
} else if (typeof selfImg === 'string' && selfImg[0] === '/') {
|
||||
global.__OASIS_SELF_AVATAR__ = selfImg;
|
||||
} else {
|
||||
global.__OASIS_SELF_AVATAR__ = null;
|
||||
}
|
||||
} catch (_) { }
|
||||
try {
|
||||
const stats = await statsModel.getStats('ALL');
|
||||
const totalMB = parseSizeMB(stats.statsBlobsSize) + parseSizeMB(stats.statsBlockchainSize);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue