gitlab-org--gitlab-foss/app/assets/javascripts/ide/stores/modules/editor/getters.js

14 lines
316 B
JavaScript

import { getFileEditorOrDefault } from './utils';
export const activeFileEditor = (state, getters, rootState, rootGetters) => {
const { activeFile } = rootGetters;
if (!activeFile) {
return null;
}
const { path } = rootGetters.activeFile;
return getFileEditorOrDefault(state.fileEditors, path);
};