Qr generator create bug fix
This commit is contained in:
26
dist/app.js
vendored
26
dist/app.js
vendored
@@ -2429,12 +2429,15 @@ var EnhancedSecureP2PChat = () => {
|
||||
if (typeof window.encodeBinaryToPrefixed === "function") {
|
||||
const bin = window.encodeBinaryToPrefixed(offerString);
|
||||
const TARGET_CHUNKS = 4;
|
||||
let FRAME_MAX = Math.max(200, Math.floor(bin.length / TARGET_CHUNKS));
|
||||
let total = TARGET_CHUNKS;
|
||||
let FRAME_MAX = Math.max(200, Math.ceil(bin.length / TARGET_CHUNKS));
|
||||
if (FRAME_MAX <= 0) FRAME_MAX = 200;
|
||||
let total = Math.ceil(bin.length / FRAME_MAX);
|
||||
if (total < 2) {
|
||||
total = 2;
|
||||
FRAME_MAX = Math.ceil(bin.length / 2) || 1;
|
||||
if (bin.length <= FRAME_MAX) {
|
||||
total = 1;
|
||||
FRAME_MAX = bin.length;
|
||||
} else {
|
||||
FRAME_MAX = Math.ceil(bin.length / TARGET_CHUNKS);
|
||||
total = TARGET_CHUNKS;
|
||||
}
|
||||
const id = `bin_${Date.now()}_${Math.random().toString(36).slice(2)}`;
|
||||
const chunks = [];
|
||||
@@ -2549,12 +2552,15 @@ var EnhancedSecureP2PChat = () => {
|
||||
if (typeof window.encodeBinaryToPrefixed === "function") {
|
||||
const bin = window.encodeBinaryToPrefixed(answerString);
|
||||
const TARGET_CHUNKS = 4;
|
||||
let FRAME_MAX = Math.max(200, Math.floor(bin.length / TARGET_CHUNKS));
|
||||
let total = TARGET_CHUNKS;
|
||||
let FRAME_MAX = Math.max(200, Math.ceil(bin.length / TARGET_CHUNKS));
|
||||
if (FRAME_MAX <= 0) FRAME_MAX = 200;
|
||||
let total = Math.ceil(bin.length / FRAME_MAX);
|
||||
if (total < 2) {
|
||||
total = 2;
|
||||
FRAME_MAX = Math.ceil(bin.length / 2) || 1;
|
||||
if (bin.length <= FRAME_MAX) {
|
||||
total = 1;
|
||||
FRAME_MAX = bin.length;
|
||||
} else {
|
||||
FRAME_MAX = Math.ceil(bin.length / TARGET_CHUNKS);
|
||||
total = TARGET_CHUNKS;
|
||||
}
|
||||
const id = `ans_${Date.now()}_${Math.random().toString(36).slice(2)}`;
|
||||
const chunks = [];
|
||||
|
||||
Reference in New Issue
Block a user