Просмотр исходного кода

禁用 webk 自动更新功能,注释掉相关代码以防止自动更新逻辑执行

wuyi 3 месяцев назад
Родитель
Сommit
36b9581583
1 измененных файлов с 44 добавлено и 43 удалено
  1. 44 43
      src/lib/appManagers/apiUpdatesManager.ts

+ 44 - 43
src/lib/appManagers/apiUpdatesManager.ts

@@ -762,49 +762,50 @@ class ApiUpdatesManager {
       this.setProxy();
       // });
 
-      if(newVersion) {
-        this.updatesState.syncLoading.then(async() => {
-          const strs: Record<string, string> = {
-            en: 'was updated to version',
-            ru: 'обновлён до версии'
-          };
-
-          const getChangelog = (lang: string) => {
-            return fetch(`changelogs/${lang}_${newVersion.split(' ')[0]}.md`)
-            .then((res) => (res.status === 200 && res.ok && res.text()) || Promise.reject())
-            .then((text) => {
-              const langStr = strs[lang] || strs.en;
-              const pre = `**Telegram Web${App.suffix} ${langStr} ${newVersion}**\n\n`;
-
-              text = pre + text;
-
-              const [message, entities] = parseMarkdown(text, []);
-
-              const update: Update.updateServiceNotification = {
-                _: 'updateServiceNotification',
-                entities,
-                message,
-                type: 'local',
-                pFlags: {},
-                inbox_date: tsNow(true),
-                media: undefined
-              };
-
-              this.processLocalUpdate(update);
-            });
-          };
-
-          const languages = filterUnique([langCode, 'en']);
-          for(const language of languages) {
-            try {
-              await getChangelog(language);
-              break;
-            } catch(err) {
-
-            }
-          }
-        });
-      }
+      // 禁用 webk 自动更新功能
+      // if(false && newVersion) {
+      //   this.updatesState.syncLoading.then(async() => {
+      //     const strs: Record<string, string> = {
+      //       en: 'was updated to version',
+      //       ru: 'обновлён до версии'
+      //     };
+
+      //     const getChangelog = (lang: string) => {
+      //       return fetch(`changelogs/${lang}_${newVersion.split(' ')[0]}.md`)
+      //       .then((res) => (res.status === 200 && res.ok && res.text()) || Promise.reject())
+      //       .then((text) => {
+      //         const langStr = strs[lang] || strs.en;
+      //         const pre = `**Telegram Web${App.suffix} ${langStr} ${newVersion}**\n\n`;
+
+      //         text = pre + text;
+
+      //         const [message, entities] = parseMarkdown(text, []);
+
+      //         const update: Update.updateServiceNotification = {
+      //           _: 'updateServiceNotification',
+      //           entities,
+      //           message,
+      //           type: 'local',
+      //           pFlags: {},
+      //           inbox_date: tsNow(true),
+      //           media: undefined
+      //         };
+
+      //         this.processLocalUpdate(update);
+      //       });
+      //     };
+
+      //     const languages = filterUnique([langCode, 'en']);
+      //     for(const language of languages) {
+      //       try {
+      //         await getChangelog(language);
+      //         break;
+      //       } catch(err) {
+
+      //       }
+      //     }
+      //   });
+      // }
     });
   }
 }