From 98d4dfd8e6aa77760a53ac11c5544f6f5af42482 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 27 Mar 2023 15:37:28 -0500 Subject: [PATCH] Move copy function to platform --- src/domain/session/room/timeline/tiles/BaseMessageTile.js | 3 +-- src/platform/web/Platform.js | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/domain/session/room/timeline/tiles/BaseMessageTile.js b/src/domain/session/room/timeline/tiles/BaseMessageTile.js index 3412b3f9..90da4bff 100644 --- a/src/domain/session/room/timeline/tiles/BaseMessageTile.js +++ b/src/domain/session/room/timeline/tiles/BaseMessageTile.js @@ -17,7 +17,6 @@ limitations under the License. import {SimpleTile} from "./SimpleTile.js"; import {ReactionsViewModel} from "../ReactionsViewModel.js"; import {getIdentifierColorNumber, avatarInitials, getAvatarHttpUrl} from "../../../../avatar"; -import {copyPlaintext} from "../../../../../platform/web/dom/utils"; export class BaseMessageTile extends SimpleTile { @@ -47,7 +46,7 @@ export class BaseMessageTile extends SimpleTile { } copyPermalink() { - copyPlaintext(this.permaLink); + this.platform.copyPlaintext(this.permaLink); } get senderProfileLink() { diff --git a/src/platform/web/Platform.js b/src/platform/web/Platform.js index be8c9970..e2f722e6 100644 --- a/src/platform/web/Platform.js +++ b/src/platform/web/Platform.js @@ -43,6 +43,7 @@ import {MediaDevicesWrapper} from "./dom/MediaDevices"; import {DOMWebRTC} from "./dom/WebRTC"; import {ThemeLoader} from "./theming/ThemeLoader"; import {TimeFormatter} from "./dom/TimeFormatter"; +import {copyPlaintext} from "./dom/utils"; function addScript(src) { return new Promise(function (resolve, reject) { @@ -283,6 +284,10 @@ export class Platform { } } + async copyPlaintext(text) { + return await copyPlaintext(text); + } + restart() { document.location.reload(); }