Skip to content

Commit

Permalink
Merge pull request #109 from OlibhiaGhosh/feat_1
Browse files Browse the repository at this point in the history
[Fix]: Error Handling Enhancement in `refreshSnippetList` Function
  • Loading branch information
shivaypiece authored May 24, 2024
2 parents f0de615 + 59eaa48 commit 15d1194
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,26 @@ export function App(): React.JSX.Element {
handleDeSelect();
}
};

function refreshSnippetList() {
new Pieces.AssetsApi().assetsSnapshot({}).then((assets) => {
// console.log('Response', assets)
clearArray()

for (let i = 0; i < assets.iterable.length; i++) {
let _local: LocalAsset = {
id: assets.iterable[i].id,
name: assets.iterable[i].name,
classification: assets.iterable[i].original.reference.classification.specific
async function refreshSnippetList() {
try {
const assets = await new Pieces.AssetsApi().assetsSnapshot({});
clearArray();

for (let i = 0; i < assets.iterable.length; i++) {
let _local: LocalAsset = {
id: assets.iterable[i].id,
name: assets.iterable[i].name,
classification: assets.iterable[i].original.reference.classification.specific
}
console.log("refreshSnippet", i, _local);
refresh(_local);
}
console.log("refreshSnippet",i,_local);
refresh(_local);
} catch (error) {
console.error(error);
setError(true);
}
}).catch((error) => {
console.error(error);
setError(true);
});
}
}


async function searchSnippetList(snippetName: string) {
try {
Expand Down

0 comments on commit 15d1194

Please sign in to comment.