Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fixes #5168 - Localize disconnect alert message (#5169)
Browse files Browse the repository at this point in the history
  • Loading branch information
punamdahiya authored and jaredhirsch committed Nov 16, 2018
1 parent 104fc94 commit a23e377
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions locales/en-US/server.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ settingsDescription = You can sign in with Firefox Accounts to sync all your scr
settingsPageSubHeader = Sync & Accounts
settingsClosePreferences =
.title = Close preferences
settingsFxaDisconnectAlertMessage = Are you sure you want to disconnect this device from your Firefox Account?
## Shotindex page

Expand Down
9 changes: 8 additions & 1 deletion server/src/pages/settings/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class Body extends React.Component {

renderAccountInfo() {
const defaultAvatar = this.props.staticLink("/static/img/default-profile.svg");
const disconnectAlertMessage = <Localized id="settingsFxaDisconnectAlertMessage">
<div id="disconnectAlertMessage" hidden>
Are you sure you want to disconnect this device from your Firefox Account?
</div>
</Localized>;
let info;
let subInfo;
if (this.props.accountInfo) {
Expand Down Expand Up @@ -90,12 +95,14 @@ class Body extends React.Component {
</Localized>
{ info }
{ subInfo}
{ disconnectAlertMessage }
</div>;
}

onClickDisconnect() {
sendEvent("start-disconnect", "settings", { useBeacon: true });
if (window.confirm("Are you sure you want to disconnect this device from your Firefox account?")) {
const message = document.getElementById("disconnectAlertMessage").textContent;
if (window.confirm(message)) {
sendEvent("confirm-disconnect", "settings-popup-confirm", { useBeacon: true });
controller.disconnectDevice();
} else {
Expand Down

0 comments on commit a23e377

Please sign in to comment.