Use doMaybeLocalRoomAction (#9038)
* Use doMaybeLocalRoomAction * Revert unnecessary changes
This commit is contained in:
parent
9b8b8763f7
commit
3be20cf434
12 changed files with 333 additions and 22 deletions
|
@ -26,6 +26,7 @@ import Modal from "../../../Modal";
|
|||
import QuestionDialog from "../dialogs/QuestionDialog";
|
||||
import SdkConfig from "../../../SdkConfig";
|
||||
import { OwnBeaconStore } from "../../../stores/OwnBeaconStore";
|
||||
import { doMaybeLocalRoomAction } from "../../../utils/local-room";
|
||||
|
||||
export enum LocationShareType {
|
||||
Own = 'Own',
|
||||
|
@ -95,10 +96,11 @@ export const shareLocation = (
|
|||
try {
|
||||
const threadId = relation?.rel_type === THREAD_RELATION_TYPE.name ? relation.event_id : null;
|
||||
const assetType = shareType === LocationShareType.Pin ? LocationAssetType.Pin : LocationAssetType.Self;
|
||||
await client.sendMessage(
|
||||
const content = makeLocationContent(undefined, uri, timestamp, undefined, assetType);
|
||||
await doMaybeLocalRoomAction(
|
||||
roomId,
|
||||
threadId,
|
||||
makeLocationContent(undefined, uri, timestamp, undefined, assetType),
|
||||
(actualRoomId: string) => client.sendMessage(actualRoomId, threadId, content),
|
||||
client,
|
||||
);
|
||||
} catch (error) {
|
||||
handleShareError(error, openMenu, shareType);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue