Skip to content

Commit

Permalink
Corrected region-stripping regex in msgs getter ↞ [auto-sync from `ad…
Browse files Browse the repository at this point in the history
…amlui/chatgpt-apps/chatgpt-auto-refresh`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed Jun 17, 2024
1 parent 26d01e1 commit d850395
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chatgpt/chatgpt-auto-refresh/chatgpt-auto-refresh.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
// @description:zu *NGOKUPHEPHA* susa ukusetha kabusha ingxoxo yemizuzu eyi-10 + amaphutha enethiwekhi ahlala njalo + Ukuhlolwa kwe-Cloudflare ku-ChatGPT.
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.6.12
// @version 2024.6.16
// @license MIT
// @match *://chatgpt.com/*
// @match *://chat.openai.com/*
Expand Down Expand Up @@ -304,7 +304,7 @@
} catch (err) { // if bad response
msgXHRtries++ ; if (msgXHRtries == 3) return resolve({}) // try up to 3X (original/region-stripped/EN) only
msgHref = config.userLanguage.includes('-') && msgXHRtries == 1 ? // if regional lang on 1st try...
msgHref.replace(/([^_]*)_[^/]*(\/.*)/, '$1$2') // ...strip region before retrying
msgHref.replace(/([^_]+_[^_]+)_[^/]*(\/.*)/, '$1$2') // ...strip region before retrying
: ( msgHostDir + 'en/messages.json' ) // else use default English messages
GM.xmlHttpRequest({ method: 'GET', url: msgHref, onload: onLoad })
}
Expand Down

0 comments on commit d850395

Please sign in to comment.