1
0
mirror of https://github.com/lencx/ChatGPT.git synced 2024-10-01 01:06:13 -04:00

chore: remove gpt4 mobile

This commit is contained in:
lencx 2023-07-20 13:34:23 +08:00
parent bcec5775bb
commit 119570c4d0
2 changed files with 2 additions and 35 deletions

35
scripts/chat.js vendored
View File

@ -1,6 +1,6 @@
/** /**
* @name chat.js * @name chat.js
* @version 0.1.3 * @version 0.1.4
* @url https://github.com/lencx/ChatGPT/tree/main/scripts/chat.js * @url https://github.com/lencx/ChatGPT/tree/main/scripts/chat.js
*/ */
@ -25,7 +25,6 @@ function chatInit() {
}); });
document.addEventListener('visibilitychange', focusOnInput); document.addEventListener('visibilitychange', focusOnInput);
gpt4Mobile();
autoContinue(); autoContinue();
} }
@ -117,38 +116,6 @@ function chatInit() {
}; };
} }
function gpt4Mobile() {
const originFetch = fetch;
window.fetch = (url, options) => {
return originFetch(url, options).then(async (response) => {
if (url.indexOf('/backend-api/models') === -1) {
return response;
}
const responseClone = response.clone();
let res = await responseClone.json();
res.models = res.models.map((m) => {
m.tags = m.tags.filter((t) => {
return t !== 'mobile';
});
if (m.slug === 'gpt-4-mobile') {
res.categories.push({
browsing_model: null,
category: 'gpt_4',
code_interpreter_model: null,
default_model: 'gpt-4-mobile',
human_category_name: 'GPT-4-Mobile',
plugins_model: null,
subscription_level: 'plus',
});
}
return m;
});
return new Response(JSON.stringify(res), response);
});
};
}
function autoContinue() { function autoContinue() {
// Create an instance of the observer // Create an instance of the observer
const observer = new MutationObserver((mutationsList) => { const observer = new MutationObserver((mutationsList) => {

View File

@ -6,7 +6,7 @@
"scripts": [ "scripts": [
{ {
"name": "chat.js", "name": "chat.js",
"version": "0.1.3" "version": "0.1.4"
}, },
{ {
"name": "cmd.js", "name": "cmd.js",