This reverts commit 5ea0436051.
This commit is contained in:
@@ -5,12 +5,7 @@ import * as types from '../mutation-types';
|
||||
import authAPI from '../../api/auth';
|
||||
import createAxios from '../../helper/APIHelper';
|
||||
import actionCable from '../../helper/actionCable';
|
||||
import {
|
||||
setUser,
|
||||
getHeaderExpiry,
|
||||
clearCookiesOnLogout,
|
||||
clearLocalStorageOnLogout,
|
||||
} from '../utils/api';
|
||||
import { setUser, getHeaderExpiry, clearCookiesOnLogout } from '../utils/api';
|
||||
import { getLoginRedirectURL } from '../../helper/URLHelper';
|
||||
|
||||
const state = {
|
||||
@@ -99,9 +94,9 @@ export const actions = {
|
||||
.login(credentials)
|
||||
.then(response => {
|
||||
commit(types.default.SET_CURRENT_USER);
|
||||
clearLocalStorageOnLogout();
|
||||
window.axios = createAxios(axios);
|
||||
actionCable.init(Vue);
|
||||
|
||||
window.location = getLoginRedirectURL(ssoAccountId, response.data);
|
||||
resolve();
|
||||
})
|
||||
|
||||
@@ -35,10 +35,3 @@ export const applyPageFilters = (conversation, filters) => {
|
||||
|
||||
return shouldFilter;
|
||||
};
|
||||
|
||||
export const trimMessage = (content = '', maxLength = 1024) => {
|
||||
if (content.length > maxLength) {
|
||||
return content.substring(0, maxLength);
|
||||
}
|
||||
return content;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
findPendingMessageIndex,
|
||||
applyPageFilters,
|
||||
trimMessage,
|
||||
} from '../../conversations/helpers';
|
||||
|
||||
const conversationList = [
|
||||
@@ -120,9 +119,3 @@ describe('#applyPageFilters', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#trimMessage', () => {
|
||||
expect(trimMessage('Hello world', 5)).toEqual('Hello');
|
||||
expect(trimMessage('Hello', 5)).toEqual('Hello');
|
||||
expect(trimMessage(undefined, 5)).toEqual('');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user