[FIX] Server Version (#1392)
This commit is contained in:
parent
b7ebd3bc07
commit
5ff07a65fe
|
@ -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');
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 });
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue