fix the type on the messagesView(the view of files)
This commit is contained in:
parent
b4a9b8af6e
commit
07f0fd5b40
|
@ -1,12 +1,12 @@
|
||||||
export default function (message: { type: string; url: string }) {
|
export default function (message: { type: string; url: string }) {
|
||||||
if (/image/.test(message.type)) {
|
if (/image/.test(message.type)) {
|
||||||
return { image_url: message.url };
|
return { image_url: message.url, image_type: message.type };
|
||||||
}
|
}
|
||||||
if (/audio/.test(message.type)) {
|
if (/audio/.test(message.type)) {
|
||||||
return { audio_url: message.url };
|
return { audio_url: message.url, audio_type: message.type };
|
||||||
}
|
}
|
||||||
if (/video/.test(message.type)) {
|
if (/video/.test(message.type)) {
|
||||||
return { video_url: message.url };
|
return { video_url: message.url, video_type: message.type };
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
title_link: message.url,
|
title_link: message.url,
|
|
@ -10,7 +10,7 @@ import Message from '../../containers/message';
|
||||||
import ActivityIndicator from '../../containers/ActivityIndicator';
|
import ActivityIndicator from '../../containers/ActivityIndicator';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import StatusBar from '../../containers/StatusBar';
|
import StatusBar from '../../containers/StatusBar';
|
||||||
import getFileUrlFromMessage from './getFileUrlFromMessage';
|
import getFileUrlAndTypeFromMessage from './getFileUrlAndTypeFromMessage';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { TSupportedThemes, withTheme } from '../../theme';
|
import { TSupportedThemes, withTheme } from '../../theme';
|
||||||
import { getUserSelector } from '../../selectors/login';
|
import { getUserSelector } from '../../selectors/login';
|
||||||
|
@ -203,7 +203,7 @@ class MessagesView extends React.Component<IMessagesViewProps, IMessagesViewStat
|
||||||
{
|
{
|
||||||
title: item.name,
|
title: item.name,
|
||||||
description: item.description,
|
description: item.description,
|
||||||
...getFileUrlFromMessage(item)
|
...getFileUrlAndTypeFromMessage(item)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Reference in New Issue