// @flow
/* eslint-disable flowtype/require-return-type */

import {
  CLEAN_NEW_DISK_DIALOG_SUBTREE,
  SET_NEW_DISK_DIALOG_PROGRESS_INDICATOR,
  SET_NEW_DISK_DIALOG_ERROR_TEXT,
  SET_NEW_DISK_DIALOG_DONE,
} from '_/constants'

export function cleanNewDiskDialogSubtree () {
  return {
    type: CLEAN_NEW_DISK_DIALOG_SUBTREE,
  }
}

export function setNewDiskDialogProgressIndicator (visible: boolean) {
  return {
    type: SET_NEW_DISK_DIALOG_PROGRESS_INDICATOR,
    payload: { visible },
  }
}

export function setNewDiskDialogErrorText (errorText: boolean) {
  return {
    type: SET_NEW_DISK_DIALOG_ERROR_TEXT,
    payload: { errorText },
  }
}

export function setNewDiskDialogDone () {
  return {
    type: SET_NEW_DISK_DIALOG_DONE,
  }
}

// @flow
/* eslint-disable flowtype/require-return-type */

import {
  CLEAN_NEW_DISK_DIALOG_SUBTREE,
  SET_NEW_DISK_DIALOG_PROGRESS_INDICATOR,
  SET_NEW_DISK_DIALOG_ERROR_TEXT,
  SET_NEW_DISK_DIALOG_DONE,
} from './constants'

export function cleanNewDiskDialogSubtree () {
  return {
    type: CLEAN_NEW_DISK_DIALOG_SUBTREE,
  }
}

export function setNewDiskDialogProgressIndicator (visible: boolean) {
  return {
    type: SET_NEW_DISK_DIALOG_PROGRESS_INDICATOR,
    payload: { visible },
  }
}

export function setNewDiskDialogErrorText (errorText: boolean) {
  return {
    type: SET_NEW_DISK_DIALOG_ERROR_TEXT,
    payload: { errorText },
  }
}

export function setNewDiskDialogDone () {
  return {
    type: SET_NEW_DISK_DIALOG_DONE,
  }
}

Fix a broken constants.js import
Fix a broken constants.js import

The import of `constants` in NewDiskDialog/actions.js was changed
to use the App level constants in error. The disk create option still
works but redux reports an error on the browser console. Fixed the
import, fixed the error.
