mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-23 03:18:36 +00:00
fix(web/radial): check whether radial menu was closed during transition
Closing the radial menu during the transition from the more pages would cause the menu to be stuck open
This commit is contained in:
1 parent
709d512422
commit
6e1a978038
2 files changed
+18
-3
No files matched your search
@@ -70,8 +70,11 @@ const RadialMenu: React.FC = () => {
|
||||
|
||||
const changePage = async (increment?: boolean) => {
|
||||
setVisible(false);
|
||||
// May cause issues if user toggles off the menu while in transition?
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
|
||||
const didTransition: boolean = await fetchNui('radialTransition');
|
||||
|
||||
if (!didTransition) return;
|
||||
|
||||
setVisible(true);
|
||||
setMenu({ ...menu, page: increment ? menu.page + 1 : menu.page - 1 });
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user