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'}
|
||||
{...events}
|
||||
>
|
||||
{!isShy && (
|
||||
{isSelecting && !isShy && (
|
||||
<>
|
||||
{isForeignObject ? (
|
||||
<HoverIndicator
|
||||
|
|
|
@ -71,11 +71,7 @@ class SessionManager {
|
|||
* ```
|
||||
*/
|
||||
complete<T extends BaseSession>(...args: Parameters<T['complete']>) {
|
||||
const session = this.#current
|
||||
|
||||
if (session === undefined) return this
|
||||
|
||||
session.complete.call(this.#current, ...args)
|
||||
this.#current?.complete.call(this.#current, ...args)
|
||||
this.#current = undefined
|
||||
return this
|
||||
}
|
||||
|
@ -89,7 +85,7 @@ class SessionManager {
|
|||
* ```
|
||||
*/
|
||||
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
|
||||
return this
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue