EmissarySocial / emissary

The Social Web Toolkit
https://emissary.dev
GNU Affero General Public License v3.0
132 stars 14 forks source link

Double inclusion of header #360

Closed andrewmoise closed 5 months ago

andrewmoise commented 5 months ago

Hey there -- so in looking at the HTML generated for some pages on the setup server, it looks like the header is included twice:

I solved the problem for me by just removing this code from SetupPageGet() entirely:

               if useWrapper {
                       if err := templates.ExecuteTemplate(ctx.Response().Writer, "_header.html", config); err != nil {
                               derp.Report(builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.getIndex", "Error building index page")))
                       }
               }

... but I didn't understand the issues involved fully, so maybe it'd be better to remove it from the template side instead, or maybe there's a more sophisticated fix needed. But in any case, removing that code made it work for me on the limited number of pages I checked.

benpate commented 5 months ago

Hey, thank you. I'm looking at this now.

benpate commented 5 months ago

It looks like you're exactly right. I have no excuse. I probably just missed this when I was moving some things around, and then didn't notice it because it didn't show up in the UI.

We can also remove the "footer" too, for the same reasons, that simplifies this function even further.

I've just pushed a fix to dev that'll get included when I do another release to main. This should be pretty soon, because I've stacked up a bunch of changes since the last one :)

benpate commented 5 months ago

okay to close this?

andrewmoise commented 5 months ago

Yeah, fine for me