Fix remaining overlay.remove bypassing winStack
Found 5 places that did overlay.remove() + history.back() directly instead of going through winStack: - Session detail recalculate/refresh - Delete supplement - Delete bike - Delete goal marker - Goal marker add button - Compare session selection All converted to: winStack.pop().close() + _skipPops + history.back() No more direct overlay.remove() outside of winStack close handlers.
This commit is contained in:
parent
4960f2a863
commit
5f0c21741c
1 changed files with 13 additions and 7 deletions
|
|
@ -1921,8 +1921,9 @@ async function showGoalMarkersModal() {
|
|||
btn.onclick = async (e) => {
|
||||
e.stopPropagation();
|
||||
await DB.deleteGoalMarker(parseInt(btn.dataset.mid));
|
||||
// Refresh modal
|
||||
overlay.remove();
|
||||
// Close and reopen modal
|
||||
if (winStack.length > 0) winStack.pop().close();
|
||||
_skipPops = 1;
|
||||
history.back();
|
||||
showGoalMarkersModal();
|
||||
};
|
||||
|
|
@ -1930,7 +1931,8 @@ async function showGoalMarkersModal() {
|
|||
|
||||
// Add button
|
||||
overlay.querySelector("#gm-add").onclick = () => {
|
||||
overlay.remove();
|
||||
if (winStack.length > 0) winStack.pop().close();
|
||||
_skipPops = 1;
|
||||
history.back();
|
||||
showAddGoalMarkerModal();
|
||||
};
|
||||
|
|
@ -2830,7 +2832,8 @@ async function showSessionDetail(sessionId) {
|
|||
recalcBtn.disabled = false;
|
||||
if (newStats) {
|
||||
// Close modal and reopen with fresh data
|
||||
document.querySelector(".modal-overlay")?.remove();
|
||||
if (winStack.length > 0) winStack.pop().close();
|
||||
_skipPops = 1;
|
||||
history.back();
|
||||
showSessionDetail(sessionId);
|
||||
}
|
||||
|
|
@ -3010,7 +3013,8 @@ async function showCompareModal(sessionId, currentSession, currentPoints) {
|
|||
item.onclick = async () => {
|
||||
const compId = parseInt(item.dataset.sid);
|
||||
// Close this modal, open comparison view
|
||||
overlay.remove();
|
||||
if (winStack.length > 0) winStack.pop().close();
|
||||
_skipPops = 1;
|
||||
history.back();
|
||||
await showComparisonView(sessionId, compId, currentSession, currentPoints);
|
||||
};
|
||||
|
|
@ -3323,7 +3327,8 @@ function showEditSupplementModal(existing) {
|
|||
delBtn.onclick = async (e) => {
|
||||
e.stopPropagation();
|
||||
await DB.deleteSupplement(existing.id);
|
||||
document.querySelector(".modal-overlay")?.remove();
|
||||
if (winStack.length > 0) winStack.pop().close();
|
||||
_skipPops = 1;
|
||||
history.back();
|
||||
renderScreen("supplements");
|
||||
};
|
||||
|
|
@ -3730,7 +3735,8 @@ async function showBikeModal(bikeId) {
|
|||
delBtn.onclick = async (e) => {
|
||||
e.stopPropagation();
|
||||
await DB.deleteBike(bikeId);
|
||||
document.querySelector(".modal-overlay")?.remove();
|
||||
if (winStack.length > 0) winStack.pop().close();
|
||||
_skipPops = 1;
|
||||
history.back();
|
||||
renderScreen("settings");
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue