What happened?
Back button dosnt go back to index if the last page wast index. aka you clicked on git banner to get latest bin.
To Reproduce Bug
Click the git banner. then use back gesture on android. then use the back botton. It now takes you back to the git page as it tracks the last page and dosnt actually go to index page.
Expected Behavior
back goes back to last entry in the main page.
Anything else?
Here is a fully working solution for reference:
function goBackToMainPage() {
let stepsBack = 0;
const mainPages = ['/#Colors', '/#Effects', '/#Segments', '/#Presets'];
function isMainPage() {
const currentPage = window.location.href;
return mainPages.some(page => currentPage.includes(page));
}
function navigateBack() {
if (stepsBack < 60) { // Prevent infinite loop
stepsBack++;
window.history.back();
setTimeout(() => {
if (!isMainPage()) {
navigateBack();
}
}, 100); // Wait for navigation to take effect
} else {
// Fallback if no "main" page is found
window.location = '/';
}
}
if (!isMainPage()) {
navigateBack();
} else {
// If already on a main page
console.log("You're already on a main page!");
}
}
and ofc the html:
<button type="button" onclick="goBackToMainPage()">Back</button>
Code of Conduct
What happened?
Back button dosnt go back to index if the last page wast index. aka you clicked on git banner to get latest bin.
To Reproduce Bug
Click the git banner. then use back gesture on android. then use the back botton. It now takes you back to the git page as it tracks the last page and dosnt actually go to index page.
Expected Behavior
back goes back to last entry in the main page.
Anything else?
Here is a fully working solution for reference:
and ofc the html:
Code of Conduct