Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 626a4cc

Browse files
committed
Make warning bold, close copied tooltip on escape
Signed-off-by: Aaron Raimist <[email protected]>
1 parent 31ff05a commit 626a4cc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
6060
});
6161
}
6262

63+
componentWillUnmount() {
64+
// if the Copied tooltip is open then get rid of it, there are ways to close the modal which wouldn't close
65+
// the tooltip otherwise, such as pressing Escape
66+
if (this.closeCopiedTooltip) this.closeCopiedTooltip();
67+
}
68+
6369
private onClearCacheAndReload = (e) => {
6470
if (!PlatformPeg.get()) return;
6571

@@ -168,7 +174,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
168174
...toRightOf(buttonRect, 2),
169175
message: successful ? _t('Copied!') : _t('Failed to copy'),
170176
});
171-
target.onmouseleave = close;
177+
this.closeCopiedTooltip = target.onmouseleave = close;
172178
}
173179

174180
render() {
@@ -290,8 +296,8 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
290296
<br />
291297
<details>
292298
<summary>{_t("Access Token")}</summary><br />
293-
{ _t("Your access token gives full access to your account."
294-
+ " Do not share it with anyone." ) }
299+
<b>{_t("Your access token gives full access to your account."
300+
+ " Do not share it with anyone." )}</b>
295301
<div className="mx_HelpUserSettingsTab_accessToken">
296302
<code>{MatrixClientPeg.get().getAccessToken()}</code>
297303
<AccessibleTooltipButton

0 commit comments

Comments
 (0)