mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-31 09:22:49 -05:00
Apply mouseup handler faster in hopes of reducing drag glitches
This commit is contained in:
@@ -5,7 +5,13 @@ import ReconnectingWebSocket from 'reconnecting-websocket'
|
|||||||
import * as Y from 'yjs'
|
import * as Y from 'yjs'
|
||||||
import { patch as patchJSON } from 'jsondiffpatch'
|
import { patch as patchJSON } from 'jsondiffpatch'
|
||||||
import { h, Fragment, render } from 'preact'
|
import { h, Fragment, render } from 'preact'
|
||||||
import { useEffect, useState, useCallback, useRef } from 'preact/hooks'
|
import {
|
||||||
|
useEffect,
|
||||||
|
useLayoutEffect,
|
||||||
|
useState,
|
||||||
|
useCallback,
|
||||||
|
useRef,
|
||||||
|
} from 'preact/hooks'
|
||||||
import { State } from 'xstate'
|
import { State } from 'xstate'
|
||||||
import styled, { createGlobalStyle } from 'styled-components'
|
import styled, { createGlobalStyle } from 'styled-components'
|
||||||
import { useHotkeys } from 'react-hotkeys-hook'
|
import { useHotkeys } from 'react-hotkeys-hook'
|
||||||
@@ -214,7 +220,7 @@ function App({ wsEndpoint }) {
|
|||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
}, [])
|
}, [])
|
||||||
const [dragEnd, setDragEnd] = useState()
|
const [dragEnd, setDragEnd] = useState()
|
||||||
useEffect(() => {
|
useLayoutEffect(() => {
|
||||||
function endDrag() {
|
function endDrag() {
|
||||||
if (dragStart !== undefined) {
|
if (dragStart !== undefined) {
|
||||||
stateDoc.transact(() => {
|
stateDoc.transact(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user