@mtcute/core 0.26.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,11 +64,10 @@ class CurrentUserService extends base.BaseService {
64
64
  _cached;
65
65
  async store(info) {
66
66
  if (info && this._cached) {
67
- if (this._cached.userId === info.userId) {
68
- return;
69
- }
70
67
  this._cached.userId = info.userId;
71
68
  this._cached.isBot = info.isBot;
69
+ this._cached.isPremium = info.isPremium;
70
+ this._cached.usernames = info.usernames;
72
71
  } else {
73
72
  this._cached = info;
74
73
  }
@@ -87,7 +86,9 @@ class CurrentUserService extends base.BaseService {
87
86
  return obj;
88
87
  }
89
88
  async fetch() {
90
- if (this._cached) return this._cached;
89
+ if (this._cached) {
90
+ return this._cached;
91
+ }
91
92
  const data = await this._kv.get(KV_CURRENT_USER);
92
93
  if (!data) return null;
93
94
  const info = parse(data);
@@ -57,11 +57,10 @@ class CurrentUserService extends BaseService {
57
57
  _cached;
58
58
  async store(info) {
59
59
  if (info && this._cached) {
60
- if (this._cached.userId === info.userId) {
61
- return;
62
- }
63
60
  this._cached.userId = info.userId;
64
61
  this._cached.isBot = info.isBot;
62
+ this._cached.isPremium = info.isPremium;
63
+ this._cached.usernames = info.usernames;
65
64
  } else {
66
65
  this._cached = info;
67
66
  }
@@ -80,7 +79,9 @@ class CurrentUserService extends BaseService {
80
79
  return obj;
81
80
  }
82
81
  async fetch() {
83
- if (this._cached) return this._cached;
82
+ if (this._cached) {
83
+ return this._cached;
84
+ }
84
85
  const data = await this._kv.get(KV_CURRENT_USER);
85
86
  if (!data) return null;
86
87
  const info = parse(data);
@@ -225,7 +225,7 @@ class NetworkManager {
225
225
  _: "initConnection",
226
226
  deviceModel,
227
227
  systemVersion: "1.0",
228
- appVersion: "0.26.0",
228
+ appVersion: "0.26.1",
229
229
  systemLangCode: "en",
230
230
  langPack: "",
231
231
  // "langPacks are for official apps only"
@@ -218,7 +218,7 @@ class NetworkManager {
218
218
  _: "initConnection",
219
219
  deviceModel,
220
220
  systemVersion: "1.0",
221
- appVersion: "0.26.0",
221
+ appVersion: "0.26.1",
222
222
  systemLangCode: "en",
223
223
  langPack: "",
224
224
  // "langPacks are for official apps only"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mtcute/core",
3
3
  "type": "module",
4
- "version": "0.26.0",
4
+ "version": "0.26.1",
5
5
  "description": "Type-safe library for MTProto (Telegram API)",
6
6
  "license": "MIT",
7
7
  "scripts": {},