(cherry picked from commit 5874e58dd1)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
parent
37fb33c6a7
commit
550498bfc0
4 changed files with 7 additions and 3 deletions
|
|
@ -50,7 +50,7 @@ const Footer = forwardRef<FooterRef, FooterProps>((props: FooterProps, ref) => {
|
|||
const message = formatMessage({id: 'mobile.public_link.copied', defaultMessage: 'Public link copied'});
|
||||
const res = await Client4.getFilePublicLink(props.file.id);
|
||||
Clipboard.setString(res.link);
|
||||
showToast(message, undefined, callback);
|
||||
showToast(message, 100, callback);
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('An error occurred, we should show a different toast', e);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const Actions = (props: ActionsProps) => {
|
|||
};
|
||||
}, []);
|
||||
|
||||
let linkActionVisible = !props.file.id.startsWith('uid');
|
||||
let linkActionVisible = !props.file.id.startsWith('uid') && props.enablePublicLink;
|
||||
if (managedConfig?.copyPasteProtection === 'true') {
|
||||
linkActionVisible = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,15 +3,18 @@
|
|||
|
||||
import {connect} from 'react-redux';
|
||||
|
||||
import {canDownloadFilesOnMobile} from '@mm-redux/selectors/entities/general';
|
||||
import {canDownloadFilesOnMobile, getConfig} from '@mm-redux/selectors/entities/general';
|
||||
|
||||
import type {GlobalState} from '@mm-redux/types/store';
|
||||
|
||||
import Actions from './actions';
|
||||
|
||||
function mapStateToProps(state: GlobalState) {
|
||||
const config = getConfig(state);
|
||||
|
||||
return {
|
||||
canDownloadFiles: canDownloadFilesOnMobile(state),
|
||||
enablePublicLink: config?.EnablePublicLink === 'true',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
1
types/screens/gallery.d.ts
vendored
1
types/screens/gallery.d.ts
vendored
|
|
@ -21,6 +21,7 @@ export interface ActionProps {
|
|||
|
||||
export interface ActionsProps {
|
||||
canDownloadFiles: boolean;
|
||||
enablePublicLink: boolean;
|
||||
downloadAction: ActionCallback;
|
||||
file: FileInfo;
|
||||
linkAction: ActionCallback;
|
||||
|
|
|
|||
Loading…
Reference in a new issue