1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-01 22:26:24 -07:00

Fix frontend not getting board string from location for banner

This commit is contained in:
Eggbertx 2023-04-11 13:28:54 -07:00
parent 64956ecd2d
commit eca996b546
2 changed files with 10 additions and 7 deletions

View file

@ -58,7 +58,7 @@ See [`frontend/README.md`](frontend/README.md) for information on working with S
## Roadmap
### Near future
* Add some banners
* Add more banners
* Add config option to strip metadata from uploaded images
* Add more plugin support (more event triggers)
* Improve moderation tools

View file

@ -5,13 +5,16 @@ export function setPageBanner() {
url: `${webroot}util/banner`,
dataType: "json"
};
const board = location.pathname.split("/")[0];
if(board !== "") {
data.data = {
const slashArr = location.pathname.split("/");
const board = (slashArr.length >= 2)?slashArr[1]:"";
$.get({
url: `${webroot}util/banner`,
data: {
board: board
};
}
$.get(data).then(data => {
},
dataType: "json"
}).then(data => {
if(!data || data.Filename == undefined || data.Filename == "") {
return; // no banners :(
}