fix early break in sessions
This commit is contained in:
parent
2c6545806a
commit
84827eea96
2 changed files with 3 additions and 7 deletions
|
@ -68,7 +68,7 @@ function Shape({ id, isSelecting, parentPoint }: ShapeProps): JSX.Element {
|
||||||
device={isMobileDevice ? 'mobile' : 'desktop'}
|
device={isMobileDevice ? 'mobile' : 'desktop'}
|
||||||
{...events}
|
{...events}
|
||||||
>
|
>
|
||||||
{!isShy && (
|
{isSelecting && !isShy && (
|
||||||
<>
|
<>
|
||||||
{isForeignObject ? (
|
{isForeignObject ? (
|
||||||
<HoverIndicator
|
<HoverIndicator
|
||||||
|
|
|
@ -71,11 +71,7 @@ class SessionManager {
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
complete<T extends BaseSession>(...args: Parameters<T['complete']>) {
|
complete<T extends BaseSession>(...args: Parameters<T['complete']>) {
|
||||||
const session = this.#current
|
this.#current?.complete.call(this.#current, ...args)
|
||||||
|
|
||||||
if (session === undefined) return this
|
|
||||||
|
|
||||||
session.complete.call(this.#current, ...args)
|
|
||||||
this.#current = undefined
|
this.#current = undefined
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
@ -89,7 +85,7 @@ class SessionManager {
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
cancel<T extends BaseSession>(...args: Parameters<T['cancel']>) {
|
cancel<T extends BaseSession>(...args: Parameters<T['cancel']>) {
|
||||||
this.#current.cancel.call(this.#current, ...args)
|
this.#current?.cancel.call(this.#current, ...args)
|
||||||
this.#current = undefined
|
this.#current = undefined
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue