arclanguage / anarki

Community-managed fork of the Arc dialect of Lisp; for commit privileges submit a pull request.
http://arclanguage.github.io
Other
1.17k stars 160 forks source link

Topright becomes 'login' when trying to submit #192

Closed tarvos21 closed 3 years ago

tarvos21 commented 3 years ago

Hi, I run anarki/apps/news on my Macbook, with Racket 8.0, I can create account and posts, however, when I try to submit post, the topright corner becomes 'login'.

If I have logged in, I can submit successfully. But it's wierd, the topright is supposed to show usernames, I think.

Any suggestions how to fix this? Thanks!

截屏2021-03-05 08 41 00
akkartik commented 3 years ago

I can reproduce this, and I also see the problem. Stay tuned..

akkartik commented 3 years ago

Try it now? My change is just a band-aid. You might see a few other places that have the same problem. Hopefully this commit shows how to clean them up.

tarvos21 commented 3 years ago

@akkartik It's great for the submit page now, thanks!

kennethrapp commented 3 years ago

This is weird, because all of the subtemplates like minipage just end up calling the longpage template. There may be some arguments in the wrong order.

akkartik commented 3 years ago

minipage doesn't take a user, and it passes a nil user down to its callees. Before, it just never showed anything in the top right. Now it misleads. So it might be worth looking at all calls of this family of functions and checking the code to see if argument defaults are sensible. Sometimes you have a user and it's better to pass it on. In other words it's useful to replace calls to minipage with something else. And so on.

kennethrapp commented 3 years ago

I see now. I just made a quick check and it looks like every function that calls minipage could get access to the user, so there's probably no reason it should ever be nil. I can probably get this fixed by tomorrow.