Commit b9b8ee0d authored by tom's avatar tom

change ovserver for addresses

parent 9b410245
......@@ -78,10 +78,12 @@ const AddressWithDots = ({ address, fontWeight, truncated }: Props) => {
useEffect(() => {
if (!truncated) {
const resizeHandler = _debounce(calculateString, 50);
window.addEventListener('resize', resizeHandler);
const resizeHandler = _debounce(calculateString, 100);
const resizeObserver = new ResizeObserver(resizeHandler);
resizeObserver.observe(document.body);
return function cleanup() {
window.removeEventListener('resize', resizeHandler);
resizeObserver.unobserve(document.body);
};
}
}, [ calculateString, truncated ]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment