Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Revert Livechat packages upgrades/removals that were causing issues #26077

Merged
merged 2 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/meteor/app/livechat/server/api/v1/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ API.v1.addRoute('livechat/config', {
const config = await cachedSettings({ businessUnit });

const status = Livechat.online(department);
const guest = token && Livechat.findGuest(token);
const guest = token && (await Livechat.findGuest(token));

const room = guest && findOpenRoom(token);
const agent = guest && room && room.servedBy && findAgent(room.servedBy._id);
Expand Down
3 changes: 2 additions & 1 deletion packages/livechat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"url-loader": "^4.1.0",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^4.9.2"
MartinSchoeler marked this conversation as resolved.
Show resolved Hide resolved
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"@rocket.chat/fuselage-tokens": "~0.31.11",
Expand All @@ -87,6 +87,7 @@
"css-vars-ponyfill": "^2.3.2",
"date-fns": "^2.15.0",
"emoji-mart": "^3.0.0",
"history": "^5.3.0",
"i18next": "^21.8.4",
"markdown-it": "^11.0.0",
"mem": "^6.1.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/livechat/src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Router, route } from 'preact-router';
import { parse } from 'query-string';
import { withTranslation } from 'react-i18next';

import history from '../../history';
import Connection from '../../lib/connection';
import CustomFields from '../../lib/customFields';
import Hooks from '../../lib/hooks';
Expand Down Expand Up @@ -230,7 +231,7 @@ export class App extends Component {
};

return (
<Router onChange={this.handleRoute}>
<Router history={history} onChange={this.handleRoute}>
<ChatConnector default path='/' {...screenProps} />
<ChatFinished path='/chat-finished' {...screenProps} />
<GDPRAgreement path='/gdpr' {...screenProps} />
Expand Down
5 changes: 5 additions & 0 deletions packages/livechat/src/history.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createMemoryHistory } from 'history';

export const history = createMemoryHistory();

export default history;
2 changes: 1 addition & 1 deletion packages/livechat/src/routes/Register/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class RegisterContainer extends Component {
const { user: prevUser } = prevProps;
const { user } = this.props;

if (!prevUser && user && user._id) {
if ((!prevUser || Object.keys(prevUser).length === 0) && user && user._id) {
route('/');
}
}
Expand Down
Loading