@vishu1301/script-writing 1.2.5 → 1.2.7

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
@@ -2485,18 +2485,15 @@ function useScriptBreakdownScene(options) {
2485
2485
  }, [options.preLoadedTags]);
2486
2486
  react.useEffect(() => {
2487
2487
  const doBulkCreate = async () => {
2488
- if (blocks.length > 0 && !autoTaggedSceneRef.current) {
2489
- const hasPreloadedTags = options.preLoadedTags && options.preLoadedTags.length > 0;
2490
- if (hasPreloadedTags) {
2491
- autoTaggedSceneRef.current = options.scene_url;
2492
- return;
2493
- }
2494
- autoTaggedSceneRef.current = options.scene_url;
2495
- await bulkCreateTags();
2496
- }
2488
+ if (blocks.length === 0) return;
2489
+ if (autoTaggedSceneRef.current === options.scene_url) return;
2490
+ const hasPreloadedTags = options.preLoadedTags && options.preLoadedTags.length > 0;
2491
+ autoTaggedSceneRef.current = options.scene_url;
2492
+ if (hasPreloadedTags) return;
2493
+ await bulkCreateTags();
2497
2494
  };
2498
2495
  doBulkCreate();
2499
- }, [blocks, options.scene_url, options.preLoadedTags, bulkCreateTags]);
2496
+ }, [blocks, options.scene_url, options.preLoadedTags]);
2500
2497
  const clearSelection = react.useCallback(() => {
2501
2498
  var _a;
2502
2499
  setSelectionMenu(null);