minor changes

This commit is contained in:
sairaj mote 2022-11-11 23:27:09 +05:30
parent a0f1ce6399
commit d6c4c6401a
3 changed files with 8 additions and 8 deletions

Binary file not shown.

View File

@ -2354,10 +2354,11 @@
const extension = getRef('get_minified').checked ? '.min.js' : '.js' const extension = getRef('get_minified').checked ? '.min.js' : '.js'
const filesList = [] const filesList = []
selectedComponents.forEach(async component => { selectedComponents.forEach(async component => {
for (let compObj in allComponentsObj) { for (const compObj in allComponentsObj) {
const { name, download_url } = allComponentsObj[compObj] const { name, download_url } = allComponentsObj[compObj]
if (name === `${component}${extension}`) { if (name === `${component}${extension}`) {
filesList.push(fetch(download_url).then(async res => await res.text())) filesList.push(fetch(download_url).then(async res => await res.text()))
break;
} }
} }
}); });
@ -2367,8 +2368,7 @@
const selectedComponents = await getSelectedComponents() const selectedComponents = await getSelectedComponents()
if (selectedComponents.length) { if (selectedComponents.length) {
downloadJs(selectedComponents, { minified: getRef('get_minified').checked }) downloadJs(selectedComponents, { minified: getRef('get_minified').checked })
} } else {
else {
notify('Please select at least one component', 'error') notify('Please select at least one component', 'error')
} }
} }
@ -2388,7 +2388,7 @@
let allComponentsObj = [] let allComponentsObj = []
async function getComponents() { async function getComponents() {
const files = await fetch('https://api.github.com/repos/ranchimall/standard-visual-design-system/contents/components/dist') const files = await fetch('https://api.github.com/repos/ranchimall/standard-ui/contents/components/dist')
allComponentsObj = await files.json() allComponentsObj = await files.json()
} }
function downloadJs(componentsArray, options = { minified: true }) { function downloadJs(componentsArray, options = { minified: true }) {

View File

@ -740,10 +740,11 @@
const extension = getRef('get_minified').checked ? '.min.js' : '.js' const extension = getRef('get_minified').checked ? '.min.js' : '.js'
const filesList = [] const filesList = []
selectedComponents.forEach(async component => { selectedComponents.forEach(async component => {
for (let compObj in allComponentsObj) { for (const compObj in allComponentsObj) {
const { name, download_url } = allComponentsObj[compObj] const { name, download_url } = allComponentsObj[compObj]
if (name === `${component}${extension}`) { if (name === `${component}${extension}`) {
filesList.push(fetch(download_url).then(async res => await res.text())) filesList.push(fetch(download_url).then(async res => await res.text()))
break;
} }
} }
}); });
@ -753,8 +754,7 @@
const selectedComponents = await getSelectedComponents() const selectedComponents = await getSelectedComponents()
if (selectedComponents.length) { if (selectedComponents.length) {
downloadJs(selectedComponents, { minified: getRef('get_minified').checked }) downloadJs(selectedComponents, { minified: getRef('get_minified').checked })
} } else {
else {
notify('Please select at least one component', 'error') notify('Please select at least one component', 'error')
} }
} }
@ -774,7 +774,7 @@
let allComponentsObj = [] let allComponentsObj = []
async function getComponents() { async function getComponents() {
const files = await fetch('https://api.github.com/repos/ranchimall/standard-visual-design-system/contents/components/dist') const files = await fetch('https://api.github.com/repos/ranchimall/standard-ui/contents/components/dist')
allComponentsObj = await files.json() allComponentsObj = await files.json()
} }
function downloadJs(componentsArray, options = { minified: true }) { function downloadJs(componentsArray, options = { minified: true }) {