Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lata 11/fix/261 #282

Closed
wants to merge 2 commits into from
Closed

Lata 11/fix/261 #282

wants to merge 2 commits into from

Conversation

lata-11
Copy link

@lata-11 lata-11 commented Dec 19, 2023

Description

The code doesn't fix any bug or add new feature.
It minimize promise chaining in asynchronous functions.
Replaced .then with “async - await” wherever possible.

Please describe the changes in your pull request in few words here.

Changes

Before:
const fetchVersion = () => {
return getFossologyVersion()
.then((res) => {
setSessionStorage("fossologyVersion", res);
setVersion(res);
return res;
})
.catch(() => null);
};
After:
const fetchVersion = async () => {
try {
const res = await getFossologyVersion();
setSessionStorage("fossologyVersion", res);
setVersion(res);
return res;
} catch (error) {
return null;
}
};

Please consider using the closing keyword if the pull request is proposed to
fix an issue already created in the repository
closes #261
(https://help.github.com/articles/closing-issues-using-keywords/)

@lata-11 lata-11 closed this Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant