Fix player not loading new version after applying effects

Reload the player with the version-specific audio URL when effects are
applied to the currently playing generation. Also consolidate the
instruct/effects buttons into a single button with the effects editor
shown inline when instruct mode is open.
This commit is contained in:
Jamie Pine
2026-03-14 08:01:45 -07:00
parent 3d922ec846
commit 25134b4ba9
2 changed files with 23 additions and 47 deletions
+16 -1
View File
@@ -234,11 +234,26 @@ export function HistoryTable() {
if (!effectsTargetId || effectsChain.length === 0) return;
setApplyingEffects(true);
try {
await apiClient.applyEffectsToGeneration(effectsTargetId, {
const newVersion = await apiClient.applyEffectsToGeneration(effectsTargetId, {
effects_chain: effectsChain,
set_as_default: true,
});
queryClient.invalidateQueries({ queryKey: ['history'] });
// If the player is currently on this generation, reload with the new version audio
if (currentAudioId === effectsTargetId) {
const gen = allHistory.find((g) => g.id === effectsTargetId);
if (gen) {
const versionUrl = apiClient.getVersionAudioUrl(newVersion.id);
setAudioWithAutoPlay(
versionUrl,
effectsTargetId,
gen.profile_id,
gen.text.substring(0, 50),
);
}
}
setEffectsDialogOpen(false);
toast({ title: 'Effects applied', description: 'A new version has been created.' });
} catch (error) {