feat: update notification settings (#10529)

https://github.com/user-attachments/assets/52ecf3f8-0329-4268-906e-d6102338f4af

---------

Co-authored-by: Pranav <pranav@chatwoot.com>
Co-authored-by: Pranav <pranavrajs@gmail.com>
This commit is contained in:
Shivam Mishra
2024-12-05 19:05:04 +05:30
committed by GitHub
parent d635be4b2a
commit cdff624a0a
21 changed files with 794 additions and 292 deletions

View File

@@ -26,7 +26,13 @@ export default {
emitter.off('newToastMessage', this.onNewToastMessage);
},
methods: {
onNewToastMessage({ message, action }) {
onNewToastMessage({ message: originalMessage, action }) {
// FIX ME: This is a temporary workaround to pass string from functions
// that doesn't have the context of the VueApp.
const usei18n = action?.usei18n;
const duration = action?.duration || this.duration;
const message = usei18n ? this.$t(originalMessage) : originalMessage;
this.snackMessages.push({
key: new Date().getTime(),
message,
@@ -34,7 +40,7 @@ export default {
});
window.setTimeout(() => {
this.snackMessages.splice(0, 1);
}, this.duration);
}, duration);
},
},
};