@crowdin/app-project-module 1.0.2 → 1.1.0

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.
@@ -1697,11 +1697,17 @@
1697
1697
  const allFolderFiles = scheduleModal.querySelector('#all-folder-files').checked || false;
1698
1698
  const type = scheduleModal.getAttribute('data-type');
1699
1699
  if (type === 'crowdin') {
1700
+ const crowdinFiles = await appComponent.current.getCrowdinFilesData();
1701
+ const syncedFileIds = Object.keys(syncData.current);
1702
+ const crowdinFolderIds = crowdinFiles
1703
+ .filter((file) => file.node_type === folderType || file.node_type === branchType)
1704
+ .filter((file) => syncedFileIds.includes(String(file.id)))
1705
+ .map((file) => String(file.id));
1700
1706
  appComponent.current.setCrowdinScheduleSync(syncData.current, newFile, selectedFiles);
1701
1707
  appComponent.current.setCrowdinFilesHasSyncOption(true);
1702
1708
  const syncedFiles = await appComponent.current.getCrowdinScheduleSync(true);
1703
1709
  appComponent.current.setAttribute('is-crowdin-sync-settings-in-progress', true);
1704
- updateSyncSettings(syncedFiles, 'schedule', 'crowdin');
1710
+ updateSyncSettings(syncedFiles, 'schedule', 'crowdin', [], crowdinFolderIds);
1705
1711
  }
1706
1712
  else if (type === 'integration') {
1707
1713
  if (syncNewElements === null || syncNewElements === void 0 ? void 0 : syncNewElements.integration) {
@@ -1928,7 +1934,7 @@
1928
1934
  }
1929
1935
  updateSyncSettings(syncedFiles, 'schedule', 'crowdin');
1930
1936
  }
1931
- function updateSyncSettings(files, type, provider, expandIntegrationFolders = []) {
1937
+ function updateSyncSettings(files, type, provider, expandIntegrationFolders = [], folderIds = []) {
1932
1938
  checkOrigin()
1933
1939
  .then((restParams) => fetch('api/sync-settings' + restParams, {
1934
1940
  method: 'POST',
@@ -1939,6 +1945,7 @@
1939
1945
  provider,
1940
1946
  expandIntegrationFolders,
1941
1947
  hasLoadMoreElements: hasLoadMoreElements.current,
1948
+ folderIds,
1942
1949
  }),
1943
1950
  }))
1944
1951
  .then(checkResponse)