mirror of
https://github.com/langgenius/dify.git
synced 2025-11-22 07:56:37 +00:00
17 lines
358 B
TypeScript
17 lines
358 B
TypeScript
|
|
class TooltipManager {
|
||
|
|
private activeCloser: (() => void) | null = null
|
||
|
|
|
||
|
|
register(closeFn: () => void) {
|
||
|
|
if (this.activeCloser)
|
||
|
|
this.activeCloser()
|
||
|
|
this.activeCloser = closeFn
|
||
|
|
}
|
||
|
|
|
||
|
|
clear(closeFn: () => void) {
|
||
|
|
if (this.activeCloser === closeFn)
|
||
|
|
this.activeCloser = null
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export const tooltipManager = new TooltipManager()
|