Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
Allow Slider to accept custom history prop
Richie McIlroy4c3b942ca107
diff --git a/apps/desktop/src/routes/editor/ui.tsx b/apps/desktop/src/routes/editor/ui.tsxindex 83d8b4caf..8601aa0d7 100644--- a/apps/desktop/src/routes/editor/ui.tsx+++ b/apps/desktop/src/routes/editor/ui.tsx@@ -65,9 +65,11 @@ export function Subfield(export function Slider(props: ComponentProps<typeof KSlider> & {formatTooltip?: string | ((v: number) => string);+ history?: { pause: () => () => void };},) {- const { projectHistory: history } = useEditorContext();+ const context = useEditorContext();+ const history = props.history ?? context?.projectHistory;// Pause history when slider is being draggedlet resumeHistory: (() => void) | null = null;@@ -86,7 +88,7 @@ export function Slider(props.class,)}onChange={(v) => {- if (!resumeHistory) resumeHistory = history.pause();+ if (!resumeHistory && history) resumeHistory = history.pause();props.onChange?.(v);}}onChangeEnd={(e) => {