Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3519115
D9830.id33146.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9830.id33146.diff
View Options
diff --git a/native/profile/keyserver-selection-bottom-sheet.react.js b/native/profile/keyserver-selection-bottom-sheet.react.js
--- a/native/profile/keyserver-selection-bottom-sheet.react.js
+++ b/native/profile/keyserver-selection-bottom-sheet.react.js
@@ -4,7 +4,9 @@
import * as React from 'react';
import { View, Text } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
+import { useDispatch } from 'react-redux';
+import { removeKeyserverActionType } from 'lib/actions/keyserver-actions.js';
import type { KeyserverInfo } from 'lib/types/keyserver-types.js';
import type { GlobalAccountUserInfo } from 'lib/types/user-types.js';
@@ -92,9 +94,37 @@
);
}, []);
+ const dispatch = useDispatch();
+
+ const onDeleteKeyserver = React.useCallback(() => {
+ dispatch({
+ type: removeKeyserverActionType,
+ payload: {
+ keyserverAdminUserID: keyserverAdminUserInfo.id,
+ },
+ });
+
+ bottomSheetRef.current?.close();
+ }, [dispatch, keyserverAdminUserInfo.id]);
+
const onPressRemoveKeyserver = React.useCallback(() => {
- // TODO
- }, []);
+ Alert.alert(
+ 'Delete keyserver',
+ 'Are you sure you want to delete this keyserver from your keyserver ' +
+ 'list? You will still remain in the associated communities.',
+ [
+ {
+ text: 'Delete',
+ style: 'destructive',
+ onPress: onDeleteKeyserver,
+ },
+ {
+ text: 'Cancel',
+ style: 'cancel',
+ },
+ ],
+ );
+ }, [onDeleteKeyserver]);
const removeKeyserver = React.useMemo(() => {
if (keyserverInfo.connection.status !== 'connected') {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 9:24 PM (18 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2696616
Default Alt Text
D9830.id33146.diff (1 KB)
Attached To
Mode
D9830: [native] introduce functionality for onPressRemoveKeyserver callback
Attached
Detach File
Event Timeline
Log In to Comment