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

Don't await getMe() in updates

painor 3 лет назад
Родитель
Сommit
1bef3f1c42
4 измененных файлов с 7 добавлено и 9 удалено
  1. 1 1
      gramjs/Version.ts
  2. 3 5
      gramjs/client/updates.ts
  3. 2 2
      package-lock.json
  4. 1 1
      package.json

+ 1 - 1
gramjs/Version.ts

@@ -1 +1 @@
-export const version = "2.0.12";
+export const version = "2.0.14";

+ 3 - 5
gramjs/client/updates.ts

@@ -122,11 +122,9 @@ export async function _dispatchUpdate(
         let event = args.update;
         let event = args.update;
         if (event) {
         if (event) {
             if (!client._selfInputPeer) {
             if (!client._selfInputPeer) {
-                try {
-                    await client.getMe(true);
-                } catch (e) {
-                    // we don't care about this.
-                }
+                client.getMe(true).catch(()=>{
+                    // do nothing
+                });
             }
             }
             if (!(event instanceof UpdateConnectionState)) {
             if (!(event instanceof UpdateConnectionState)) {
                 // TODO fix me
                 // TODO fix me

+ 2 - 2
package-lock.json

@@ -1,12 +1,12 @@
 {
 {
   "name": "telegram",
   "name": "telegram",
-  "version": "2.0.12",
+  "version": "2.0.14",
   "lockfileVersion": 2,
   "lockfileVersion": 2,
   "requires": true,
   "requires": true,
   "packages": {
   "packages": {
     "": {
     "": {
       "name": "telegram",
       "name": "telegram",
-      "version": "2.0.12",
+      "version": "2.0.14",
       "license": "MIT",
       "license": "MIT",
       "dependencies": {
       "dependencies": {
         "@cryptography/aes": "^0.1.1",
         "@cryptography/aes": "^0.1.1",

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "telegram",
   "name": "telegram",
-  "version": "2.0.12",
+  "version": "2.0.14",
   "description": "NodeJS/Browser MTProto API Telegram client library,",
   "description": "NodeJS/Browser MTProto API Telegram client library,",
   "main": "index.js",
   "main": "index.js",
   "types": "index.d.ts",
   "types": "index.d.ts",