Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3241551
D9906.id33303.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9906.id33303.diff
View Options
diff --git a/native/profile/add-keyserver.react.js b/native/profile/add-keyserver.react.js
--- a/native/profile/add-keyserver.react.js
+++ b/native/profile/add-keyserver.react.js
@@ -14,6 +14,7 @@
import HeaderRightTextButton from '../navigation/header-right-text-button.react.js';
import { useSelector } from '../redux/redux-utils.js';
import { useStyles, useColors } from '../themes/colors.js';
+import { useStaffCanSee } from '../utils/staff-utils.js';
// eslint-disable-next-line no-unused-vars
function AddKeyserver(props: { ... }): React.Node {
@@ -21,12 +22,17 @@
const dispatch = useDispatch();
+ const staffCanSee = useStaffCanSee();
+
const currentUserID = useSelector(state => state.currentUserInfo?.id);
+ const customServer = useSelector(state => state.customServer);
const { panelForegroundTertiaryLabel } = useColors();
const styles = useStyles(unboundStyles);
- const [urlInput, setUrlInput] = React.useState('');
+ const [urlInput, setUrlInput] = React.useState(
+ customServer && staffCanSee ? customServer : '',
+ );
const [showErrorMessage, setShowErrorMessage] = React.useState(false);
const isKeyserverURLValidCallback = useIsKeyserverURLValid(urlInput);
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
@@ -20,6 +20,8 @@
import type { NavigationRoute } from '../navigation/route-names.js';
import { useColors, useStyles } from '../themes/colors.js';
import Alert from '../utils/alert.js';
+import { useStaffCanSee } from '../utils/staff-utils.js';
+import { setCustomServer } from '../utils/url-utils.js';
export type KeyserverSelectionBottomSheetParams = {
+keyserverAdminUserInfo: GlobalAccountUserInfo,
@@ -94,6 +96,8 @@
);
}, []);
+ const staffCanSee = useStaffCanSee();
+
const dispatch = useDispatch();
const onDeleteKeyserver = React.useCallback(() => {
@@ -104,8 +108,19 @@
},
});
+ if (staffCanSee) {
+ dispatch({
+ type: setCustomServer,
+ payload: keyserverInfo.urlPrefix,
+ });
+ }
bottomSheetRef.current?.close();
- }, [dispatch, keyserverAdminUserInfo.id]);
+ }, [
+ dispatch,
+ keyserverAdminUserInfo.id,
+ keyserverInfo.urlPrefix,
+ staffCanSee,
+ ]);
const onPressRemoveKeyserver = React.useCallback(() => {
Alert.alert(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 14, 7:13 PM (11 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2492205
Default Alt Text
D9906.id33303.diff (2 KB)
Attached To
Mode
D9906: [native] save the recently deleted server url to customServer redux state
Attached
Detach File
Event Timeline
Log In to Comment