mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
20 lines
531 B
TypeScript
20 lines
531 B
TypeScript
import { getComponentSettings } from '@/core/settings'
|
|
import type { CustomNavbarOptions } from '.'
|
|
|
|
export const migrateOrders = () => {
|
|
const migrations = [
|
|
['gamesIframe', 'games'],
|
|
['livesIframe', 'lives'],
|
|
['mangaIframe', 'manga'],
|
|
]
|
|
|
|
const { options } = getComponentSettings<CustomNavbarOptions>('customNavbar')
|
|
migrations.forEach(([from, to]) => {
|
|
const oldOrder = options.order[from]
|
|
if (oldOrder !== undefined) {
|
|
options.order[to] = oldOrder
|
|
delete options.order[from]
|
|
}
|
|
})
|
|
}
|