refactor: expose replaceRoute directly
This commit is contained in:
@@ -6,7 +6,7 @@ import FooterReplyTo from 'widget/components/FooterReplyTo.vue';
|
||||
import ChatInputWrap from 'widget/components/ChatInputWrap.vue';
|
||||
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
||||
import { sendEmailTranscript } from 'widget/api/conversation';
|
||||
import { useRouterHelper } from 'widget/composables/useRouterHelper';
|
||||
import { useReplaceRoute } from 'widget/composables/useReplaceRoute';
|
||||
import { IFrameHelper } from '../helpers/utils';
|
||||
import { CHATWOOT_ON_START_CONVERSATION } from '../constants/sdkEvents';
|
||||
|
||||
@@ -16,10 +16,6 @@ export default {
|
||||
CustomButton,
|
||||
FooterReplyTo,
|
||||
},
|
||||
setup() {
|
||||
const { replaceRoute } = useRouterHelper();
|
||||
return { replaceRoute };
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inReplyTo: null,
|
||||
@@ -88,7 +84,7 @@ export default {
|
||||
startNewConversation() {
|
||||
this.clearConversations();
|
||||
this.clearConversationAttributes();
|
||||
this.replaceRoute('prechat-form');
|
||||
useReplaceRoute('prechat-form');
|
||||
IFrameHelper.sendMessage({
|
||||
event: 'onEvent',
|
||||
eventIdentifier: CHATWOOT_ON_START_CONVERSATION,
|
||||
|
||||
@@ -3,7 +3,7 @@ import availabilityMixin from 'widget/mixins/availability';
|
||||
import nextAvailabilityTime from 'widget/mixins/nextAvailabilityTime';
|
||||
import FluentIcon from 'shared/components/FluentIcon/Index.vue';
|
||||
import HeaderActions from './HeaderActions.vue';
|
||||
import { useRouterHelper } from 'widget/composables/useRouterHelper';
|
||||
import { useReplaceRoute } from 'widget/composables/useReplaceRoute';
|
||||
import darkMixin from 'widget/mixins/darkModeMixin.js';
|
||||
|
||||
export default {
|
||||
@@ -35,10 +35,6 @@ export default {
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
const { replaceRoute } = useRouterHelper();
|
||||
return { replaceRoute };
|
||||
},
|
||||
computed: {
|
||||
isOnline() {
|
||||
const { workingHoursEnabled } = this.channelConfig;
|
||||
@@ -52,7 +48,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
onBackButtonClick() {
|
||||
this.replaceRoute('home');
|
||||
useReplaceRoute('home');
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -6,7 +6,6 @@ import { getContrastingTextColor } from '@chatwoot/utils';
|
||||
import { isEmptyObject } from 'widget/helpers/utils';
|
||||
import { getRegexp } from 'shared/helpers/Validators';
|
||||
import messageFormatterMixin from 'shared/mixins/messageFormatterMixin';
|
||||
import { useRouterHelper } from 'widget/composables/useRouterHelper';
|
||||
import darkModeMixin from 'widget/mixins/darkModeMixin';
|
||||
import configMixin from 'widget/mixins/configMixin';
|
||||
|
||||
@@ -22,10 +21,6 @@ export default {
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
const { replaceRoute } = useRouterHelper();
|
||||
return { replaceRoute };
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
locale: this.$root.$i18n.locale,
|
||||
|
||||
Reference in New Issue
Block a user