scoreboard icon indicating copy to clipboard operation
scoreboard copied to clipboard

Menu bug if not admin user [local development]

Open LanesGood opened this issue 4 years ago • 3 comments

In addition to #637, I'm experiencing a bug in local development. When already signed in from previous local development sessions, clicking the "User" menu throws the following error:

TypeError: Cannot read property 'roles' of undefined
Layout.render
./pages/_app.js:195
  192 | <ul>
  193 |   <li><Link href='/dashboard'><a>Dashboard</a></Link></li>
  194 |   <li><Link href={`/users/${osm.id}`}><a>Public Profile</a></Link></li>
> 195 |   <li><Link href={`/edit-user?id=${osm.id}`} as={`/users/${osm.id}/edit`}><a>Edit Profile</a></Link></li>
  196 |   {
  197 |     account.roles && isAdmin(account.roles) && (
  198 |       <li><Link href={`/admin`}><a>Admin</a></Link></li>
View compiled

Solutions include clearing cache and application data in inspector then re-logging in, or stopping development and re-setting self as admin user.

LanesGood avatar Dec 16 '20 00:12 LanesGood

@kamicut your comments on #637 also seem to apply here. Sounds like these bugs can only affect local development - is that correct?

LanesGood avatar Dec 21 '20 15:12 LanesGood

Yes I think so, clearing the cache will work. I think we should close unless we see this in production. What do you think?

kamicut avatar Dec 21 '20 15:12 kamicut

We could also add a tag or retitle with [PROD] or [DEV]

kamicut avatar Dec 21 '20 15:12 kamicut