Skip to content

Commit

Permalink
Converted obj method defs to shorter ES6 syntax ↞ [auto-sync from `ad…
Browse files Browse the repository at this point in the history
…amlui/chatgpt-apps/bravegpt`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed Jun 25, 2024
1 parent bbefabf commit 6b7450d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions chatgpt/bravegpt/bravegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.6.24.5
// @version 2024.6.24.6
// @license MIT
// @icon https://media.bravegpt.com/images/icons/bravegpt/icon48.png?0a9e287
// @icon64 https://media.bravegpt.com/images/icons/bravegpt/icon64.png?0a9e287
Expand Down Expand Up @@ -1294,7 +1294,7 @@ setTimeout(async () => {

const get = {

reply: async function(msgChain) {
async reply(msgChain) {

// Init API attempt props
get.reply.status = 'waiting'
Expand Down Expand Up @@ -1336,7 +1336,7 @@ setTimeout(async () => {
updateFooterContent()
},

json: function(url, callback) { // for dynamic footer
json(url, callback) { // for dynamic footer
GM.xmlHttpRequest({ method: 'GET', url: url, onload: resp => {
if (resp.status >= 200 && resp.status < 300) {
try { const data = JSON.parse(resp.responseText) ; callback(null, data) }
Expand All @@ -1345,7 +1345,7 @@ setTimeout(async () => {
}})
},

related: async function(query) {
async related(query) {

// Init API attempt props
get.related.status = 'waiting'
Expand Down Expand Up @@ -1389,7 +1389,7 @@ setTimeout(async () => {

const dataProcess = {

text: function(caller, resp) {
text(caller, resp) {
return new Promise(resolve => {
let respText
const logPrefix = `get.${caller.name}() » dataProcess.text() » `
Expand Down Expand Up @@ -1485,7 +1485,7 @@ setTimeout(async () => {
})
},

stream: function(caller, stream) {
stream(caller, stream) {
if (config.streamingDisabled || !config.proxyAPIenabled) return
const reader = stream.response.getReader() ; let accumulatedChunks = ''
reader.read().then(processStreamText).catch(err => consoleErr('Error processing stream', err.message))
Expand Down Expand Up @@ -1533,7 +1533,7 @@ setTimeout(async () => {

const show = {

reply: function(answer) {
reply(answer) {

// Hide font size slider if visibile
if (appDiv.querySelector('#font-size-slider-track')) fontSizeSlider.toggle('off')
Expand Down Expand Up @@ -1859,7 +1859,7 @@ setTimeout(async () => {
}
},

related: function(queries) {
related(queries) {
if (!show.related.greenlit) { // wait for get.reply() to finish showing answer
show.related.statusChecker = setInterval(() => {
if (get.reply.status != 'waiting') {
Expand Down

0 comments on commit 6b7450d

Please sign in to comment.