hlassiege/darylpublic Fork
⑂ 2847388
Commits
⬇ Clone ▾
git clone https://git.rickub.com/hlassiege/daryl.git
git clone ssh://git@rickub.com/hlassiege/daryl.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

fix(web): refresh montage media list when returning to the tab

Media added to the shared library (or the project) after the montage was opened did not show up in the B-roll/sound/music picker until a page reload.
hlassiege committed 2026-10-11T14:36:53+02:00 Browse files
2847388 parent: 7d84a31
modified web/src/project/steps/montage/useMontage.ts +8 -0
@@ -134,6 +134,14 @@ export function useMontage(pid: string) {
134134 } catch { /* la liste reste vide */ }
135135 }
136136 loadAvailable();
137+ // un média versé dans la bibliothèque (ou le projet) depuis un autre onglet apparaît au retour sur le montage
138+ const onVisible = () => { if (document.visibilityState === "visible") loadAvailable(); };
139+ document.addEventListener("visibilitychange", onVisible);
140+ window.addEventListener("focus", loadAvailable);
141+ onUnmounted(() => {
142+ document.removeEventListener("visibilitychange", onVisible);
143+ window.removeEventListener("focus", loadAvailable);
144+ });
137145
138146 return { view, tl, available, dirty, holding, busy, total, edit, shiftBeats, save, flush, undo, send, stop, exportResolve, load, loadAvailable };
139147 }
@@ -134,6 +134,14 @@ export function useMontage(pid: string) {
134 } catch { /* la liste reste vide */ }134 } catch { /* la liste reste vide */ }
135 }135 }
136 loadAvailable();136 loadAvailable();
137+ // un média versé dans la bibliothèque (ou le projet) depuis un autre onglet apparaît au retour sur le montage
138+ const onVisible = () => { if (document.visibilityState === "visible") loadAvailable(); };
139+ document.addEventListener("visibilitychange", onVisible);
140+ window.addEventListener("focus", loadAvailable);
141+ onUnmounted(() => {
142+ document.removeEventListener("visibilitychange", onVisible);
143+ window.removeEventListener("focus", loadAvailable);
144+ });
137 145
138 return { view, tl, available, dirty, holding, busy, total, edit, shiftBeats, save, flush, undo, send, stop, exportResolve, load, loadAvailable };146 return { view, tl, available, dirty, holding, busy, total, edit, shiftBeats, save, flush, undo, send, stop, exportResolve, load, loadAvailable };
139 }147 }