chore: Replace packages with native functions (#5140)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
<script>
|
||||
import 'highlight.js/styles/default.css';
|
||||
import copy from 'copy-text-to-clipboard';
|
||||
import { copyTextToClipboard } from 'shared/helpers/clipboard';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -23,9 +23,9 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onCopy(e) {
|
||||
async onCopy(e) {
|
||||
e.preventDefault();
|
||||
copy(this.script);
|
||||
await copyTextToClipboard(this.script);
|
||||
bus.$emit('newToastMessage', this.$t('COMPONENTS.CODE.COPY_SUCCESSFUL'));
|
||||
},
|
||||
},
|
||||
|
||||
@@ -109,8 +109,6 @@
|
||||
</li>
|
||||
</template>
|
||||
<script>
|
||||
import copy from 'copy-text-to-clipboard';
|
||||
|
||||
import messageFormatterMixin from 'shared/mixins/messageFormatterMixin';
|
||||
import timeMixin from '../../../mixins/time';
|
||||
|
||||
@@ -128,6 +126,7 @@ import alertMixin from 'shared/mixins/alertMixin';
|
||||
import contentTypeMixin from 'shared/mixins/contentTypeMixin';
|
||||
import { MESSAGE_TYPE, MESSAGE_STATUS } from 'shared/constants/messages';
|
||||
import { generateBotMessageContent } from './helpers/botMessageContentHelper';
|
||||
import { copyTextToClipboard } from 'shared/helpers/clipboard';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -405,8 +404,8 @@ export default {
|
||||
this.showAlert(this.$t('CONVERSATION.FAIL_DELETE_MESSSAGE'));
|
||||
}
|
||||
},
|
||||
handleCopy() {
|
||||
copy(this.data.content);
|
||||
async handleCopy() {
|
||||
await copyTextToClipboard(this.data.content);
|
||||
this.showAlert(this.$t('CONTACT_PANEL.COPY_SUCCESSFUL'));
|
||||
this.showContextMenu = false;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user