Skip to content

Commit

Permalink
Restricted global msg fetching to non-English sys lang env for faster…
Browse files Browse the repository at this point in the history
… load ↞ [auto-sync from `adamlui/autoclear-chatgpt-history`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed May 8, 2024
1 parent 8c0e3c2 commit 0fa6653
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
// @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.5.7
// @version 2024.5.7.1
// @license MIT
// @icon https://cdn.jsdelivr.net/gh/adamlui/userscripts/chatgpt/media/icons/openai-favicon48.png
// @icon64 https://cdn.jsdelivr.net/gh/adamlui/userscripts/chatgpt/media/icons/openai-favicon64.png
Expand Down Expand Up @@ -274,6 +274,7 @@
loadSetting('autoclear', 'buttonHidden', 'notifDisabled', 'toggleHidden')

// Define MESSAGES
let msgs = {};
const msgsLoaded = new Promise(resolve => {
const msgHostDir = config.assetHostURL + 'greasemonkey/_locales/',
msgLocaleDir = ( config.userLanguage ? config.userLanguage.replace('-', '_') : 'en' ) + '/'
Expand All @@ -294,7 +295,7 @@
GM.xmlHttpRequest({ method: 'GET', url: msgHref, onload: onLoad })
}
}
}) ; const msgs = await msgsLoaded;
}) ; if (!/^en/.test(config.userLanguage)) try { msgs = await msgsLoaded; } catch (err) {}

// Init/register MENU
const state = {
Expand Down

0 comments on commit 0fa6653

Please sign in to comment.