[FIX] Server Version (#1392)

This commit is contained in:
Djorkaeff Alexandre 2019-11-18 14:50:00 -03:00 committed by Diego Mello
parent b7ebd3bc07
commit 5ff07a65fe
4 changed files with 4 additions and 4 deletions

View File

@ -91,7 +91,7 @@ export function getCustomEmojis() {
const updatedSince = await getUpdatedSince(allRecords);
// if server version is lower than 0.75.0, fetches from old api
if (semver.lt(serverVersion, '0.75.0')) {
if (serverVersion && semver.lt(serverVersion, '0.75.0')) {
// RC 0.61.0
const result = await this.sdk.get('emoji-custom');

View File

@ -79,7 +79,7 @@ export default function() {
const allRecords = await permissionsCollection.query().fetch();
// if server version is lower than 0.73.0, fetches from old api
if (semver.lt(serverVersion, '0.73.0')) {
if (serverVersion && semver.lt(serverVersion, '0.73.0')) {
// RC 0.66.0
const result = await this.sdk.get('permissions.list');
if (!result.success) {

View File

@ -1031,7 +1031,7 @@ const RocketChat = {
const serverVersion = reduxStore.getState().server.version;
// if server is lower than 1.1.0
if (semver.lt(semver.coerce(serverVersion), '1.1.0')) {
if (serverVersion && semver.lt(semver.coerce(serverVersion), '1.1.0')) {
if (this.activeUsersSubTimeout) {
clearTimeout(this.activeUsersSubTimeout);
this.activeUsersSubTimeout = false;

View File

@ -22,7 +22,7 @@ import { SERVERS, TOKEN, SERVER_URL } from '../constants/userDefaults';
const getServerInfo = function* getServerInfo({ server, raiseError = true }) {
try {
const serverInfo = yield RocketChat.getServerInfo(server);
let websocketInfo = true;
let websocketInfo = { success: true };
if (raiseError) {
websocketInfo = yield RocketChat.getWebsocketInfo({ server });
}