mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix: use .call to change context in authRequest
This commit is contained in:
@@ -13,7 +13,7 @@ export default class User {
|
|||||||
async sync() {
|
async sync() {
|
||||||
var user = await this.get();
|
var user = await this.get();
|
||||||
if (!user) return;
|
if (!user) return;
|
||||||
user = await authRequest("users", undefined, true, true);
|
user = await authRequest.call(this, "users", undefined, true, true);
|
||||||
delete user.lastSynced;
|
delete user.lastSynced;
|
||||||
await this.set(user);
|
await this.set(user);
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ export default class User {
|
|||||||
if (!user || !refno) return;
|
if (!user || !refno) return;
|
||||||
|
|
||||||
await this.set({ refno, upgrading: true });
|
await this.set({ refno, upgrading: true });
|
||||||
let response = await authRequest("upgrade", { refno }, true);
|
let response = await authRequest.call(this, "upgrade", { refno }, true);
|
||||||
if (response.duration) {
|
if (response.duration) {
|
||||||
await this.set({
|
await this.set({
|
||||||
refno: undefined,
|
refno: undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user