Ensured a recconnection happens to selected server when its params are edited

This commit is contained in:
Alejandro Celaya
2022-12-31 16:42:04 +01:00
parent d34b9b1233
commit 91f4d09608
7 changed files with 23 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
import { useState, useRef, EffectCallback, DependencyList, useEffect } from 'react';
import { useSwipeable as useReactSwipeable } from 'react-swipeable';
import { useNavigate } from 'react-router-dom';
import { useLocation, useNavigate } from 'react-router-dom';
import { v4 as uuid } from 'uuid';
import { parseQuery, stringifyQuery } from './query';
@@ -82,6 +82,11 @@ export const useGoBack = () => {
return () => navigate(-1);
};
export const useParsedQuery = <T>(): T => {
const { search } = useLocation();
return parseQuery<T>(search);
};
export const useDomId = (): string => {
const { current: id } = useRef(`dom-${uuid()}`);
return id;