Welcome to mirror list, hosted at ThFree Co, Russian Federation.

getters.js « terminal « modules « stores « ide « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ef98547ccc40e8c3f1181a872d1cf347223cf687 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// eslint-disable-next-line import/prefer-default-export
export const allCheck = state => {
  const checks = Object.values(state.checks);

  if (checks.some(check => check.isLoading)) {
    return { isLoading: true };
  }

  const invalidCheck = checks.find(check => !check.isValid);
  const isValid = !invalidCheck;
  const message = !invalidCheck ? '' : invalidCheck.message;

  return {
    isLoading: false,
    isValid,
    message,
  };
};