mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
fix: Improve bisector
This commit is contained in:
parent
de541ec953
commit
6ad8b3e27b
@ -40,7 +40,7 @@ export default Vue.extend({
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bisector-dialog-content-container {
|
||||
padding: 8px;
|
||||
padding: 12px;
|
||||
.bisector-dialog-content-text {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { DialogInstance, showDialog } from '@/core/dialog'
|
||||
import type { Settings } from '@/core/settings/types'
|
||||
import { Toast } from '@/core/toast'
|
||||
import { getRandomId, mountVueComponent, sleep } from '@/core/utils'
|
||||
import { getRandomId, mountVueComponent, delay } from '@/core/utils'
|
||||
import { useScopedConsole } from '@/core/utils/log'
|
||||
import type { RecordValue } from '../types'
|
||||
import type { BisectNext, BisectReturn } from './bisect'
|
||||
@ -93,7 +93,7 @@ export const stop = async () => {
|
||||
const msg = `部分组件未能还原状态:${getComponentNames(unmatchedComponents)}`
|
||||
scopedConsole?.warn(`stop - ${msg}`)
|
||||
Toast.error(msg, '组件二等分')
|
||||
await sleep(3e3)
|
||||
await delay(3e3)
|
||||
}
|
||||
scopedConsole?.log('stop - 清理状态')
|
||||
bisectorGenerator = null
|
||||
@ -117,7 +117,7 @@ export const next = async (seeingBad?: boolean, autoReload?: boolean) => {
|
||||
bisectorOptions.bisectInitialState = { low, high }
|
||||
const elementId = `bisector-result-toast-content-${getRandomId()}`
|
||||
Toast.info(/* html */ `<div id="${elementId}"></div>`, '组件二等分结果')
|
||||
await sleep()
|
||||
await delay()
|
||||
const vm = mountVueComponent<{ userComponent: UserComponent }>(
|
||||
ResultToastContent,
|
||||
`#${elementId}`,
|
||||
|
||||
@ -30,7 +30,7 @@ export const component = defineComponentMetadata({
|
||||
name: 'bisector-start',
|
||||
getActions: async () => [
|
||||
{
|
||||
name: '开始/继续组件二等分',
|
||||
name: '开始 / 继续组件二等分',
|
||||
description: 'Start/Continue component bisection',
|
||||
icon: 'mdi-view-split-horizontal',
|
||||
action: async () => {
|
||||
|
||||
@ -634,11 +634,3 @@ export const getRandomId = (length = 8) => {
|
||||
.join('')
|
||||
.substring(0, length)
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步延时指定毫秒数
|
||||
*
|
||||
* @param ms 传递给 setTimeout 的第二个参数,表示延时时间
|
||||
* @returns
|
||||
*/
|
||||
export const sleep = (ms?: number) => new Promise(resolve => setTimeout(resolve, ms))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user