Implemented FxA
This commit is contained in:
parent
70bc2b7656
commit
718d74fa50
40 changed files with 1306 additions and 651 deletions
|
@ -22,6 +22,14 @@ export default class OwnedFile {
|
|||
this.timeLimit = obj.timeLimit;
|
||||
}
|
||||
|
||||
get hasPassword() {
|
||||
return !!this._hasPassword;
|
||||
}
|
||||
|
||||
get expired() {
|
||||
return this.dlimit === this.dtotal || Date.now() > this.expiresAt;
|
||||
}
|
||||
|
||||
async setPassword(password) {
|
||||
try {
|
||||
this.password = password;
|
||||
|
@ -48,11 +56,9 @@ export default class OwnedFile {
|
|||
return Promise.resolve(true);
|
||||
}
|
||||
|
||||
get hasPassword() {
|
||||
return !!this._hasPassword;
|
||||
}
|
||||
|
||||
async updateDownloadCount() {
|
||||
const oldTotal = this.dtotal;
|
||||
const oldLimit = this.dlimit;
|
||||
try {
|
||||
const result = await fileInfo(this.id, this.ownerToken);
|
||||
this.dtotal = result.dtotal;
|
||||
|
@ -63,6 +69,7 @@ export default class OwnedFile {
|
|||
}
|
||||
// ignore other errors
|
||||
}
|
||||
return oldTotal !== this.dtotal || oldLimit !== this.dlimit;
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue