@vishu1301/script-writing 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2240,7 +2240,6 @@ function useScriptBreakdownScene(options) {
2240
2240
  const [isLoading, setIsLoading] = react.useState(true);
2241
2241
  const [error, setError] = react.useState(false);
2242
2242
  const menuRef = react.useRef(null);
2243
- const hasInitializedRef = react.useRef(false);
2244
2243
  react.useEffect(() => {
2245
2244
  setIsLoading(true);
2246
2245
  const fetchScene = async () => {
@@ -2486,14 +2485,21 @@ function useScriptBreakdownScene(options) {
2486
2485
  }, [options.preLoadedTags]);
2487
2486
  react.useEffect(() => {
2488
2487
  const doBulkCreate = async () => {
2489
- if (blocks.length === 0 || hasInitializedRef.current) return;
2488
+ if (blocks.length === 0) return;
2489
+ if (options.preLoadedTagsLoading) return;
2490
+ if (autoTaggedSceneRef.current === options.scene_url) return;
2490
2491
  const hasPreloadedTags = options.preLoadedTags && options.preLoadedTags.length > 0;
2491
- hasInitializedRef.current = true;
2492
+ autoTaggedSceneRef.current = options.scene_url;
2492
2493
  if (hasPreloadedTags) return;
2493
2494
  await bulkCreateTags();
2494
2495
  };
2495
2496
  doBulkCreate();
2496
- }, [blocks, options.scene_url, options.preLoadedTags]);
2497
+ }, [
2498
+ blocks,
2499
+ options.scene_url,
2500
+ options.preLoadedTags,
2501
+ options.preLoadedTagsLoading
2502
+ ]);
2497
2503
  const clearSelection = react.useCallback(() => {
2498
2504
  var _a;
2499
2505
  setSelectionMenu(null);