Skip to content

Commit eb92523

Browse files
authored
(bugfix) pause running slideshow when shifting from random<->sequential mode (#110)
1 parent cf7632d commit eb92523

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

photomap/frontend/static/javascript/search.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ export async function searchTextAndImage({
9696
max_search_results: state.maxSearchResults,
9797
};
9898

99-
console.log("searchTextAndImage payload:", payload);
10099
try {
101100
const response = await fetch(
102101
`search_with_text_and_image/${encodeURIComponent(state.album)}`,

photomap/frontend/static/javascript/slideshow.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export async function toggleSlideshowWithIndicator(e) {
9797

9898
window.dispatchEvent(new Event("slideshowStartRequested"));
9999

100-
101100
// Ensure UMAP closed if necessary
102101
if (isUmapFullscreen()) toggleUmapWindow(false);
103102

@@ -135,21 +134,18 @@ function createModeMenu(x, y) {
135134
b.style.background = "transparent";
136135
b.style.border = "none";
137136
b.style.cursor = "pointer";
138-
b.onclick = (ev) => {
139-
// NOTE: This code should be moved to state.js.
137+
b.onclick = async (ev) => {
140138
ev.stopPropagation();
141-
const previousMode = state.mode;
142139
state.mode = modeVal;
140+
removeModeMenu();
143141
saveSettingsToLocalStorage();
142+
if (slideShowRunning()) await toggleSlideshowWithIndicator();
144143
updateSlideshowButtonIcon();
145-
removeModeMenu();
146144
};
147145
return b;
148146
};
149147

150-
menu.appendChild(
151-
makeButton(PLAY_SVG, "Sequential", "chronological")
152-
);
148+
menu.appendChild(makeButton(PLAY_SVG, "Sequential", "chronological"));
153149
menu.appendChild(makeButton(SHUFFLE_SVG, "Shuffled", "random"));
154150

155151
document.body.appendChild(menu);

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "photomapai"
7-
version = "0.9.5"
7+
version = "0.9.6"
88
description = "AI-based image clustering and exploration tool"
99
authors = [
1010
{ name = "Lincoln Stein", email = "lincoln.stein@gmail.com" }

0 commit comments

Comments
 (0)