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

export default () => {};