Move copy function to platform

This commit is contained in:
Eric Eastwood 2023-03-27 15:37:28 -05:00
parent acba597e8b
commit 98d4dfd8e6
2 changed files with 6 additions and 2 deletions

View File

@ -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() {

View File

@ -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();
}