Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@filerobot/explorer / lib / components / AssetsView / AssetsView.thunks.js
Size: Mime:
import createThunk from '@filerobot/utils/lib/createThunk';
import { VIEW_IDS } from '@filerobot/utils/lib/constants';
import { changeView } from '../../slices/views.slice';
import { fetchSortedFiles } from '../../slices/files.slice';
import { currentFolderUpdated, selectBaseFolderPath } from '../../slices/folders.slice';
import { searchContextReset } from '../../slices/search.slice';
export var activateAssetsView = createThunk(function () {
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
    disableApiCall = _ref.disableApiCall,
    _ref$skipViewDispatch = _ref.skipViewDispatch,
    skipViewDispatch = _ref$skipViewDispatch === void 0 ? false : _ref$skipViewDispatch;
  var thunkApi = arguments.length > 1 ? arguments[1] : undefined;
  var dispatch = thunkApi.dispatch;
  if (!skipViewDispatch) {
    dispatch(changeView({
      view: VIEW_IDS.ASSETS
    }));
  }
  if (!disableApiCall) {
    var baseFolderPath = selectBaseFolderPath(thunkApi.getState());
    dispatch(currentFolderUpdated(baseFolderPath));
    dispatch(fetchSortedFiles({
      queries: {
        folder: baseFolderPath
      },
      offset: 0,
      replaceOldFiles: true,
      recursive: true
    }));
    dispatch(searchContextReset());
  }
});