Skip to content

Commit 14c1186

Browse files
committedDec 3, 2019
Фикс кейса падения lp
1 parent 484882d commit 14c1186

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

Diff for: ‎src/js/longpollEvents.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { supportedAttachments, preloadAttachments } from '../components/messages
33
import longpoll from 'js/longpoll';
44
import store from './store/';
55
import vkapi from './vkapi';
6-
import { timer, eventBus } from './utils';
6+
import { timer, eventBus, isObject } from './utils';
77

88
function hasFlag(mask, flag) {
99
const flags = {
@@ -96,7 +96,7 @@ function parseLongPollMessage(data) {
9696
const user = store.getters['users/user'];
9797

9898
// Если данные получены через messages.getLongPollHistory
99-
if(!Array.isArray(data)) return data;
99+
if(isObject(data)) return data;
100100
// Если это 2 событие прочтения сообщения или пометки его важным
101101
// Или юзер уже вышел из аккаунта
102102
if(!data[3] || !user) return;

Diff for: ‎src/js/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function timer(time) {
9494
return new Promise((resolve) => setTimeout(resolve, time));
9595
}
9696

97-
function isObject(obj) {
97+
export function isObject(obj) {
9898
return obj && !Array.isArray(obj) && typeof obj == 'object';
9999
}
100100

0 commit comments

Comments
 (0)
Please sign in to comment.