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:
parent
64956ecd2d
commit
eca996b546
2 changed files with 10 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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 :(
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue