mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
feat: updates
This commit is contained in:
parent
ce757215a3
commit
c1cd31840e
86 changed files with 1048 additions and 778 deletions
|
|
@ -11,9 +11,7 @@ class ScrollPositions {
|
|||
const nestedPath = `/${pathname.split('/')[1]}`
|
||||
const restPath = pathname.split('/').slice(2).join('/')
|
||||
if (this._nestedPaths.includes(nestedPath)) {
|
||||
return this._positions?.[nestedPath]?.find(
|
||||
({ path }) => path === restPath
|
||||
)?.top
|
||||
return this._positions?.[nestedPath]?.find(({ path }) => path === restPath)?.top
|
||||
} else {
|
||||
return this._generalPositions?.[pathname]
|
||||
}
|
||||
|
|
@ -30,14 +28,10 @@ class ScrollPositions {
|
|||
}
|
||||
|
||||
// set nested position
|
||||
const existsPath = this._positions[nestedPath].find(
|
||||
p => p.path === restPath
|
||||
)
|
||||
const existsPath = this._positions[nestedPath].find(p => p.path === restPath)
|
||||
if (existsPath) {
|
||||
existsPath.top = top
|
||||
this._positions[nestedPath] = this._positions[nestedPath].filter(
|
||||
p => p.path !== restPath
|
||||
)
|
||||
this._positions[nestedPath] = this._positions[nestedPath].filter(p => p.path !== restPath)
|
||||
this._positions[nestedPath].push(existsPath)
|
||||
} else {
|
||||
this._positions[nestedPath].push({ path: restPath, top })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue