Done
This commit is contained in:
parent
4b14cc1a73
commit
a6b7340e9d
4 changed files with 15 additions and 9 deletions
9
app/dist/scripts/api.js
vendored
9
app/dist/scripts/api.js
vendored
|
@ -93,6 +93,15 @@ function initializeApiFunctionality() { // eslint-disable-line no-unused-vars
|
|||
handleApiLanguageToggles("curl");
|
||||
handleApiLanguageToggles("lbrynet");
|
||||
handleApiLanguageToggles("python");
|
||||
|
||||
// Ensure version selector shows correct version, even on page reloads
|
||||
const currentValue = document.querySelector(".api-content__body h2").textContent.split(/\s/g).pop();
|
||||
const { children } = document.querySelector(".api-toc__select");
|
||||
|
||||
for (const child of children) {
|
||||
if (currentValue === child.text)
|
||||
document.querySelector(".api-toc__select").selectedIndex = child.index;
|
||||
}
|
||||
}
|
||||
|
||||
function reinitJets() {
|
||||
|
|
|
@ -26,6 +26,11 @@ const server = fastify({
|
|||
redact: ["req.headers.authorization"],
|
||||
serializers: {
|
||||
req(req) {
|
||||
// TODO: Figure out how to trigger this to test
|
||||
// It is annoying to see in development
|
||||
if (req.err && req.err.message.includes("Premature close"))
|
||||
return {};
|
||||
|
||||
return {
|
||||
headers: req.headers,
|
||||
hostname: req.hostname,
|
||||
|
|
|
@ -89,6 +89,7 @@ export default async(socket, action) => {
|
|||
newsletterSubscribe(action, socket);
|
||||
break;
|
||||
|
||||
|
||||
case action.message === "view different documentation version":
|
||||
send(socket, {
|
||||
element: "div",
|
||||
|
|
|
@ -381,10 +381,6 @@ function renderVersionSelector(pageSlug, versions, desiredTag) {
|
|||
|
||||
let optionIndex = 0;
|
||||
|
||||
// console.log("————————");
|
||||
// console.log(desiredTag);
|
||||
// console.log("————————");
|
||||
|
||||
versions.forEach(version => {
|
||||
optionIndex++;
|
||||
let selectedOption = false;
|
||||
|
@ -394,16 +390,11 @@ function renderVersionSelector(pageSlug, versions, desiredTag) {
|
|||
else if (optionIndex === 1)
|
||||
selectedOption = true;
|
||||
|
||||
// if (selectedOption === true)
|
||||
// console.log(pageSlug, version);
|
||||
|
||||
options.push(
|
||||
`<option value="${pageSlug}-${version}"${selectedOption ? " selected" : ""}>${version}</option>`
|
||||
);
|
||||
});
|
||||
|
||||
// console.log(options);
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue