scoreboard
scoreboard copied to clipboard
Menu bug if not admin user [local development]
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.
@kamicut your comments on #637 also seem to apply here. Sounds like these bugs can only affect local development - is that correct?
Yes I think so, clearing the cache will work. I think we should close unless we see this in production. What do you think?
We could also add a tag or retitle with [PROD] or [DEV]