Fix sending locations into threads and fix i18n (#7943)
This commit is contained in:
parent
0f4125dfd5
commit
3c858a723b
7 changed files with 55 additions and 40 deletions
|
@ -16,6 +16,7 @@ limitations under the License.
|
|||
|
||||
import React, { SyntheticEvent, useContext, useState } from 'react';
|
||||
import { Room } from 'matrix-js-sdk/src/models/room';
|
||||
import { IEventRelation } from 'matrix-js-sdk/src/models/event';
|
||||
|
||||
import MatrixClientContext from '../../../contexts/MatrixClientContext';
|
||||
import ContextMenu, { AboveLeftOf } from '../../structures/ContextMenu';
|
||||
|
@ -29,6 +30,7 @@ type Props = Omit<ILocationPickerProps, 'onChoose'> & {
|
|||
menuPosition: AboveLeftOf;
|
||||
openMenu: () => void;
|
||||
roomId: Room["roomId"];
|
||||
relation?: IEventRelation;
|
||||
};
|
||||
|
||||
const getEnabledShareTypes = (): LocationShareType[] => {
|
||||
|
@ -43,7 +45,12 @@ const getEnabledShareTypes = (): LocationShareType[] => {
|
|||
};
|
||||
|
||||
const LocationShareMenu: React.FC<Props> = ({
|
||||
menuPosition, onFinished, sender, roomId, openMenu,
|
||||
menuPosition,
|
||||
onFinished,
|
||||
sender,
|
||||
roomId,
|
||||
openMenu,
|
||||
relation,
|
||||
}) => {
|
||||
const matrixClient = useContext(MatrixClientContext);
|
||||
const enabledShareTypes = getEnabledShareTypes();
|
||||
|
@ -60,7 +67,7 @@ const LocationShareMenu: React.FC<Props> = ({
|
|||
<div className="mx_LocationShareMenu">
|
||||
{ shareType ? <LocationPicker
|
||||
sender={sender}
|
||||
onChoose={shareLocation(matrixClient, roomId, openMenu)}
|
||||
onChoose={shareLocation(matrixClient, roomId, relation, openMenu)}
|
||||
onFinished={onFinished}
|
||||
/>
|
||||
:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue