1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { Dispatch } from 'redux';
6 import { ServiceRepository } from '~/services/services';
7 import { propertiesActions } from '~/store/properties/properties-actions';
8 import { FILE_VIEWERS_PROPERTY_NAME, DEFAULT_FILE_VIEWERS } from '~/store/file-viewers/file-viewers-selectors';
9 import { FileViewerList } from '~/models/file-viewers-config';
11 export const loadFileViewersConfig = async (dispatch: Dispatch, _: {}, { fileViewersConfig }: ServiceRepository) => {
13 let config: FileViewerList;
15 config = await fileViewersConfig.get();
17 config = DEFAULT_FILE_VIEWERS;
20 dispatch(propertiesActions.SET_PROPERTY({
21 key: FILE_VIEWERS_PROPERTY_NAME,