fix: remove redundant array creation
This commit is contained in:
@@ -1085,7 +1085,7 @@ export default class NewTeamCollectionAdapter {
|
|||||||
authType: "inherit",
|
authType: "inherit",
|
||||||
authActive: true,
|
authActive: true,
|
||||||
}
|
}
|
||||||
auth.parentID = [...path.slice(0, i + 1)].join("/")
|
auth.parentID = path.slice(0, i + 1).join("/")
|
||||||
auth.parentName = parentFolder.title
|
auth.parentName = parentFolder.title
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1096,10 +1096,10 @@ export default class NewTeamCollectionAdapter {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
parentFolderAuth?.authType === "inherit" &&
|
parentFolderAuth?.authType === "inherit" &&
|
||||||
[...path.slice(0, i + 1)].length === 1
|
path.slice(0, i + 1).length === 1
|
||||||
) {
|
) {
|
||||||
auth = {
|
auth = {
|
||||||
parentID: [...path.slice(0, i + 1)].join("/"),
|
parentID: path.slice(0, i + 1).join("/"),
|
||||||
parentName: parentFolder.title,
|
parentName: parentFolder.title,
|
||||||
inheritedAuth: auth.inheritedAuth,
|
inheritedAuth: auth.inheritedAuth,
|
||||||
}
|
}
|
||||||
@@ -1107,7 +1107,7 @@ export default class NewTeamCollectionAdapter {
|
|||||||
|
|
||||||
if (parentFolderAuth?.authType !== "inherit") {
|
if (parentFolderAuth?.authType !== "inherit") {
|
||||||
auth = {
|
auth = {
|
||||||
parentID: [...path.slice(0, i + 1)].join("/"),
|
parentID: path.slice(0, i + 1).join("/"),
|
||||||
parentName: parentFolder.title,
|
parentName: parentFolder.title,
|
||||||
inheritedAuth: parentFolderAuth,
|
inheritedAuth: parentFolderAuth,
|
||||||
}
|
}
|
||||||
@@ -1120,7 +1120,7 @@ export default class NewTeamCollectionAdapter {
|
|||||||
const index = headers.findIndex(
|
const index = headers.findIndex(
|
||||||
(h) => h.inheritedHeader?.key === header.key
|
(h) => h.inheritedHeader?.key === header.key
|
||||||
)
|
)
|
||||||
const currentPath = [...path.slice(0, i + 1)].join("/")
|
const currentPath = path.slice(0, i + 1).join("/")
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
// Replace the existing header with the same key
|
// Replace the existing header with the same key
|
||||||
headers[index] = {
|
headers[index] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user