feat: Vite + vue 3 💚 (#10047)
Fixes https://github.com/chatwoot/chatwoot/issues/8436 Fixes https://github.com/chatwoot/chatwoot/issues/9767 Fixes https://github.com/chatwoot/chatwoot/issues/10156 Fixes https://github.com/chatwoot/chatwoot/issues/6031 Fixes https://github.com/chatwoot/chatwoot/issues/5696 Fixes https://github.com/chatwoot/chatwoot/issues/9250 Fixes https://github.com/chatwoot/chatwoot/issues/9762 --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import mila from 'markdown-it-link-attributes';
|
||||
import mentionPlugin from './markdownIt/link';
|
||||
|
||||
import MarkdownIt from 'markdown-it';
|
||||
const setImageHeight = inlineToken => {
|
||||
const imgSrc = inlineToken.attrGet('src');
|
||||
if (!imgSrc) return;
|
||||
@@ -30,7 +30,7 @@ const imgResizeManager = md => {
|
||||
});
|
||||
};
|
||||
|
||||
const md = require('markdown-it')({
|
||||
const md = MarkdownIt({
|
||||
html: false,
|
||||
xhtmlOut: true,
|
||||
breaks: true,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
export const set = (state, data) => {
|
||||
state.records = data;
|
||||
};
|
||||
@@ -20,7 +18,7 @@ export const setSingleRecord = (state, data) => {
|
||||
export const update = (state, data) => {
|
||||
state.records.forEach((element, index) => {
|
||||
if (element.id === data.id) {
|
||||
Vue.set(state.records, index, data);
|
||||
state.records[index] = data;
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -29,7 +27,7 @@ export const update = (state, data) => {
|
||||
export const updateAttributes = (state, data) => {
|
||||
state.records.forEach((element, index) => {
|
||||
if (element.id === data.id) {
|
||||
Vue.set(state.records, index, { ...state.records[index], ...data });
|
||||
state.records[index] = { ...state.records[index], ...data };
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -37,11 +35,7 @@ export const updateAttributes = (state, data) => {
|
||||
export const updatePresence = (state, data) => {
|
||||
state.records.forEach((element, index) => {
|
||||
const availabilityStatus = data[element.id];
|
||||
Vue.set(
|
||||
state.records[index],
|
||||
'availability_status',
|
||||
availabilityStatus || 'offline'
|
||||
);
|
||||
state.records[index].availability_status = availabilityStatus || 'offline';
|
||||
});
|
||||
};
|
||||
|
||||
@@ -51,7 +45,7 @@ export const updateSingleRecordPresence = (
|
||||
) => {
|
||||
const [selectedRecord] = records.filter(record => record.id === Number(id));
|
||||
if (selectedRecord) {
|
||||
Vue.set(selectedRecord, 'availability_status', availabilityStatus);
|
||||
selectedRecord.availability_status = availabilityStatus;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user