Fix the PTT button on mobile
We were using createRef() instead of useRef() in the hook, which meant we were always creating a new ref object and never actually getting the ref. This must have been working before the useEventTarget stuff due to some quirk of React / hooks...
This commit is contained in:
parent
8380894692
commit
2dcf043787
1 changed files with 2 additions and 2 deletions
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useCallback, useState, createRef } from "react";
|
import React, { useCallback, useState, useRef } from "react";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { useSpring, animated } from "@react-spring/web";
|
import { useSpring, animated } from "@react-spring/web";
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ export const PTTButton: React.FC<Props> = ({
|
||||||
enqueueNetworkWaiting,
|
enqueueNetworkWaiting,
|
||||||
setNetworkWaiting,
|
setNetworkWaiting,
|
||||||
}) => {
|
}) => {
|
||||||
const buttonRef = createRef<HTMLButtonElement>();
|
const buttonRef = useRef<HTMLButtonElement>();
|
||||||
|
|
||||||
const [activeTouchId, setActiveTouchId] = useState<number | null>(null);
|
const [activeTouchId, setActiveTouchId] = useState<number | null>(null);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue