瀏覽代碼

[fix] socketio.js for firefox

version-14
Rushabh Mehta 7 年之前
父節點
當前提交
8f0465f57e
共有 1 個檔案被更改,包括 7 行新增6 行删除
  1. +7
    -6
      socketio.js

+ 7
- 6
socketio.js 查看文件

@@ -46,15 +46,16 @@ io.on('connection', function (socket) {
return;
}




if (flags[sid]) {
// firefox reconnects multiple times on boot, so allow a few
// rapid reconnections
if (flags[sid] && flags[sid] > 4) {
// throttle this function
return;
} else {
flags[sid] = 1;
}

flags[sid] = sid;
flags[sid] += 1;
setTimeout(function () {
flags[sid] = null;
}, 10000);
@@ -76,7 +77,7 @@ io.on('connection', function (socket) {

return room
}
socket.on('frappe.model:subscribe', function (params) {
const doctype = params.doctype
const name = params.name


Loading…
取消
儲存