mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-09-22 22:28:22 +03:00
fix depth exceeded warning
This commit is contained in:
@@ -18,7 +18,7 @@ export default function ServerAddModal({route, navigation}) {
|
||||
// add option to add server address when loading a share link
|
||||
useEffect(() => {
|
||||
handleDeepLink(realm, navigation, route, setServerAddress);
|
||||
}, [route]);
|
||||
}, []);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
navigation.setOptions({
|
||||
@@ -97,14 +97,15 @@ function handleDeepLink(realm, navigation, route, setAddress: (address: string)
|
||||
const item = realm.objects(AMServer).filtered("serverAddress = $0", serverUrl);
|
||||
|
||||
if (item.length) {
|
||||
// clear modal without animating it
|
||||
navigation.setOptions({animation: "none"});
|
||||
navigation.goBack();
|
||||
navigation.navigate('server', {
|
||||
serverId: item._id.toHexString()
|
||||
});
|
||||
|
||||
// allow the homepage to render before moving on
|
||||
setTimeout(() => navigation.navigate('server', {
|
||||
serverId: item[0]._id.toHexString()
|
||||
}), 1000);
|
||||
} else {
|
||||
setAddress(serverUrl);
|
||||
}
|
||||
|
||||
// clear param from route
|
||||
navigation.setParams({serverAddress: null});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user