chore: Add a redirect link to the conversation in success toast message (#3711)

When creating a conversation from the contacts tab now we can go directly to the conversation by clicking the link in the success message

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Ximena Sandoval
2022-01-13 12:15:40 -07:00
committed by GitHub
parent 359caf754c
commit cab5a3e53b
9 changed files with 40 additions and 11 deletions

View File

@@ -4,6 +4,7 @@
v-for="snackMessage in snackMessages"
:key="snackMessage.key"
:message="snackMessage.message"
:action="snackMessage.action"
/>
</transition-group>
</template>
@@ -35,8 +36,12 @@ export default {
bus.$off('newToastMessage', this.onNewToastMessage);
},
methods: {
onNewToastMessage(message) {
this.snackMessages.push({ key: new Date().getTime(), message });
onNewToastMessage(message, action) {
this.snackMessages.push({
key: new Date().getTime(),
message,
action,
});
window.setTimeout(() => {
this.snackMessages.splice(0, 1);
}, this.duration);