refactor: 可読性のため一部でArray.prototype.at
を使うように (#11274)
* refactor: `Array.prototype.at`を使うように * fixup! refactor: `Array.prototype.at`を使うように
This commit is contained in:
parent
c0dbc3b53f
commit
2b6dbd4fcb
19 changed files with 46 additions and 44 deletions
|
@ -568,7 +568,7 @@ function fetchMoreFolders() {
|
|||
os.api('drive/folders', {
|
||||
folderId: folder.value ? folder.value.id : null,
|
||||
type: props.type,
|
||||
untilId: folders.value[folders.value.length - 1].id,
|
||||
untilId: folders.value.at(-1)?.id,
|
||||
limit: max + 1,
|
||||
}).then(folders => {
|
||||
if (folders.length === max + 1) {
|
||||
|
@ -591,7 +591,7 @@ function fetchMoreFiles() {
|
|||
os.api('drive/files', {
|
||||
folderId: folder.value ? folder.value.id : null,
|
||||
type: props.type,
|
||||
untilId: files.value[files.value.length - 1].id,
|
||||
untilId: files.value.at(-1)?.id,
|
||||
limit: max + 1,
|
||||
}).then(files => {
|
||||
if (files.length === max + 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue