cc-d/ieddit

Cannot send messages

Closed this issue · 11 comments

Eevoo commented

When I click a user profile page, there is the button for Send Messages. Currently...it does nothing.

cc-d commented

Could you elaborate? I just tested the button on a fresh account in incognito, and it seems to be working fine for me.

Are you logged in? If you are not logged in, you should get redirected to the /login page.

Eevoo commented

I am logged in, yes. Quick gifcam

GIF

Eevoo commented

I am using Firefox ESR FWIW.

cc-d commented
<h6> user profile for {{ vuser.username }}</h6>
{% if session['username'] != vuser.username %}
<a href="/message/{{ vuser.username }}"><button type="button" class="btn btn-sm btn-outline-secondary">send message</a></button>
{% else %}
<a href="/u/{{ session['username'] }}/messages/"><button type="button" class="btn btn-sm btn-outline-secondary">view messages</a></button>
{% endif %}

So this is the code associated with that button on the user page. The link is being generated correctly, so I think this may have something to do with how your browser is treating the </a> tags inside of the button tags.

Try now.

Eevoo commented

No change in the UI.

Message source is

<a href="/message/Lampshading"></a><button type="button" class="btn btn-sm btn-outline-secondary"><a href="/message/Lampshading">send message</a></button>

And if I manually navigate to https://ieddit.com/message/Lampshading it shows the page.

cc-d commented

My bad, I had not yet restarted the server to reflect the updated code changes. Should be good now.

Eevoo commented

(Pre-restarted server workaround below)

GIF

Trying the new server now

cc-d commented

That button has gray text now with the updated code :)

If this ends up being the issue, I'll have to go through the codebase and ensure every button is formatted correctly.

Eevoo commented

It works!

GIF

cc-d commented

:)

Thank you for your help.

Eevoo commented

Glad to be of service. ohwaitimean No thank you - you're the one who fixed it after all!