summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/stores/modules/terminal/getters.js
blob: b29d391845dd7a0263ac4326e4c8f20a626c232b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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,
  };
};