@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)
|
|
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)
|
|
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);
|