using a js script to remove "network error" on chatgpt. Openai AI.
script:
let current_text = "";
let old = window.PubSub.publish;
window.PubSub.publish = function(code, obj) {
if (obj.flag !== undefined) {
obj.text = `${obj.text}\n${current_text}`;
current_text = "";
delete obj.flag;
} else {
current_text = obj.text;}
old(code, obj)}
/////////////////////////////
if you got problems with the previous code, try this one:
let current_text = "";
let old = window.PubSub.publish;
window.PubSub.publish = function(code, obj) {
try {
if (obj.flag !== undefined) {
obj.text = `${obj.text}\n${current_text}`;
current_text = "";
delete obj.flag;
} else {
current_text = obj.text;
}
old(code, obj);
} catch (error) {
console.error(error);
}
}
leave a like!!!!!