Skip to content
Snippets Groups Projects
Commit 4c954a5c authored by Denys Mishunov's avatar Denys Mishunov
Browse files

Mark images as binary on init

parent de6c2f70
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -77,6 +77,7 @@ export const decorateFiles = ({
const fileFolder = parent && insertParent(parent);
 
if (name) {
const previewMode = viewerInformationForPath(name);
parentPath = fileFolder && fileFolder.path;
 
file = decorateData({
Loading
Loading
@@ -92,9 +93,9 @@ export const decorateFiles = ({
changed: tempFile,
content,
base64,
binary,
binary: (previewMode && previewMode.binary) || binary,
rawPath,
previewMode: viewerInformationForPath(name),
previewMode,
parentPath,
});
 
Loading
Loading
Loading
Loading
@@ -3,6 +3,7 @@ import { __ } from '~/locale';
const viewers = {
image: {
id: 'image',
binary: true,
},
markdown: {
id: 'markdown',
Loading
Loading
Loading
Loading
@@ -12,6 +12,7 @@ const createEntries = paths => {
 
const { name, parent } = splitParent(path);
const parentEntry = acc[parent];
const previewMode = viewerInformationForPath(name);
 
acc[path] = {
...decorateData({
Loading
Loading
@@ -22,7 +23,8 @@ const createEntries = paths => {
path,
url: createUrl(`/${TEST_PROJECT_ID}/${type}/${TEST_BRANCH_ID}/-/${escapeFileUrl(path)}`),
type,
previewMode: viewerInformationForPath(path),
previewMode,
binary: (previewMode && previewMode.binary) || false,
parentPath: parent,
parentTreeUrl: parentEntry
? parentEntry.url
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment