Page MenuHomePhabricator

D9830.id33146.diff
No OneTemporary

D9830.id33146.diff

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

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)

Event Timeline