Update
This commit is contained in:
@@ -107,8 +107,8 @@ const useResponsiveDimensions = () => {
|
||||
return dimensions;
|
||||
};
|
||||
|
||||
const Editor = () => {
|
||||
const { init } = useMediaStore();
|
||||
const Editor = ({ setInitialMeme, setInitialBackground, setInitialText }) => {
|
||||
const { init, setInitialMeme: setStoreMeme, setInitialBackground: setStoreBackground, setInitialText: setStoreText } = useMediaStore();
|
||||
const { getSetting } = useLocalSettingsStore();
|
||||
const { setSelectedTextElement } = useVideoEditorStore();
|
||||
const emitter = useMitt();
|
||||
@@ -121,8 +121,20 @@ const Editor = () => {
|
||||
const isBelowMinWidth = useViewportDetection(320);
|
||||
|
||||
useEffect(() => {
|
||||
// Set initial values if props are provided
|
||||
if (setInitialMeme) {
|
||||
setInitialMeme(setStoreMeme);
|
||||
}
|
||||
if (setInitialBackground) {
|
||||
setInitialBackground(setStoreBackground);
|
||||
}
|
||||
if (setInitialText) {
|
||||
setInitialText(setStoreText);
|
||||
}
|
||||
|
||||
// Initialize (will skip API call if initial values were set)
|
||||
init();
|
||||
}, []);
|
||||
}, [setInitialMeme, setInitialBackground, setInitialText, setStoreMeme, setStoreBackground, setStoreText, init]);
|
||||
|
||||
// Listen for text element selection (but don't auto-open sidebar)
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user