View on GitHub
File Changes
+
// @flow
+
import React, { Component } from 'react';
+
import { defineMessages, intlShape } from 'react-intl';
+
import classNames from 'classnames';
+
import { Button } from 'react-polymorph/lib/components/Button';
+
import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin';
+
import styles from './ResyncWalletButton.scss';
+

                      
+
const messages = defineMessages({
+
  label: {
+
    id: 'wallet.settings.resyncWalletButtonLabel',
+
    defaultMessage: '!!!Resync wallet',
+
    description: 'Label for the resync button on wallet settings',
+
  },
+
});
+

                      
+
type Props = {
+
  isSubmitting: boolean,
+
  onClick: Function,
+
};
+

                      
+
export default class ResyncWalletButton extends Component<Props> {
+
  static contextTypes = {
+
    intl: intlShape.isRequired,
+
  };
+

                      
+
  render() {
+
    const { onClick, isSubmitting } = this.props;
+
    const label = this.context.intl.formatMessage(messages.label);
+
    const buttonClasses = classNames([
+
      'flat',
+
      isSubmitting ? styles.isSubmitting : null,
+
    ]);
+

                      
+
    return (
+
      <Button
+
        className={buttonClasses}
+
        disabled={false}
+
        label={label}
+
        onClick={onClick}
+
        skin={ButtonSkin}
+
        themeOverrides={styles}
+
      />
+
    );
+
  }
+
}
+
@import '../../../themes/mixins/loading-spinner';
+

                      
+
.root {
+
  color: var(--theme-bordered-box-text-color) !important;
+
  font-weight: 500 !important;
+
  height: 36px !important;
+
  line-height: 36px !important;
+
  margin-left: 20px;
+
  min-width: 160px !important;
+
  width: 160px !important;
+
  &.isSubmitting {
+
    box-shadow: none !important;
+
    @include loading-spinner('../../../assets/images/spinner-light.svg');
+
  }
+
}
import globalMessages from '../../../i18n/global-messages';
import styles from './WalletSettings.scss';
import WalletRecoveryPhrase from './WalletRecoveryPhrase';
+
import ResyncWalletButton from './ResyncWalletButton';

                      
export const messages = defineMessages({
  assuranceLevelLabel: {
      '!!!You may wish to verify your recovery phrase before deletion to ensure that you can restore this wallet in the future, if desired.',
    description: 'Delete wallet warning explaining the consequences.',
  },
+
  resyncWalletHeader: {
+
    id: 'wallet.settings.resyncWallet.header',
+
    defaultMessage: '!!!Resync wallet with the blockchain',
+
    description: 'Resync wallet header on the wallet settings page.',
+
  },
+
  resyncWalletDescription: {
+
    id: 'wallet.settings.resyncWallet.description',
+
    defaultMessage:
+
      '!!!If you are experiencing issues with your wallet, or think you have an incorrect balance or transaction history, you can delete the local data stored by Daedalus and resync with the blockchain.',
+
    description: 'Resync wallet description.',
+
  },
  name: {
    id: 'wallet.settings.name.label',
    defaultMessage: '!!!Name',
  onStartEditing: Function,
  onStopEditing: Function,
  onCancelEditing: Function,
+
  onResyncWallet: Function,
  nameValidator: Function,
  activeField: ?string,
  isSubmitting: boolean,
+
  isResyncing: boolean,
  isIncentivizedTestnet: boolean,
  isInvalid: boolean,
  isLegacy: boolean,
      onStartEditing,
      onStopEditing,
      onCancelEditing,
+
      onResyncWallet,
      nameValidator,
      activeField,
      isSubmitting,
+
      isResyncing,
      isIncentivizedTestnet,
      isInvalid,
      isLegacy,
        styles.deleteWalletBox,
        styles.legacyWallet,
      ]);
+
      const resyncWalletBoxStyles = classNames([
+
        styles.resyncWalletBox,
+
        styles.legacyWallet,
+
      ]);
      return (
        <div className={styles.component}>
+
          <BorderedBox className={resyncWalletBoxStyles}>
+
            <span>{intl.formatMessage(messages.resyncWalletHeader)}</span>
+
            <div className={styles.contentBox}>
+
              <p>{intl.formatMessage(messages.resyncWalletDescription)}</p>
+
              <ResyncWalletButton
+
                isSubmitting={isResyncing}
+
                onClick={onResyncWallet}
+
              />
+
            </div>
+
          </BorderedBox>
+

                      
          <BorderedBox className={deleteWalletBoxStyles}>
            <span>{intl.formatMessage(messages.deleteWalletHeader)}</span>
            <div className={styles.contentBox}>
            />
          )}

                      
+
          <div className={styles.resyncWalletBox}>
+
            <span>{intl.formatMessage(messages.resyncWalletHeader)}</span>
+
            <div className={styles.contentBox}>
+
              <p>{intl.formatMessage(messages.resyncWalletDescription)}</p>
+
              <ResyncWalletButton
+
                isSubmitting={isResyncing}
+
                onClick={onResyncWallet}
+
              />
+
            </div>
+
          </div>
+

                      
          {error && <p className={styles.error}>{intl.formatMessage(error)}</p>}
        </BorderedBox>

                      
    padding-bottom: 30px;
    padding-top: 30px;

                      
-
    &.legacyWallet {
-
      margin-top: 0;
-
    }
-

                      
    span {
      color: var(--theme-input-label-color);
      font-family: var(--font-medium);
      }
    }
  }
+

                      
+
  .resyncWalletBox {
+
    border-top: 1px solid var(--theme-input-border-color);
+
    color: var(--theme-bordered-box-text-color);
+
    margin-top: 20px;
+
    padding-bottom: 10px;
+
    padding-top: 30px;
+

                      
+
    &.legacyWallet {
+
      border-top: none;
+
      margin-top: 0;
+
      padding-bottom: 30px;
+
    }
+

                      
+
    span {
+
      font-family: var(--font-medium);
+
    }
+
    .contentBox {
+
      align-items: center;
+
      display: flex;
+
      flex-direction: row;
+
      font-family: var(--font-light);
+
      justify-content: space-between;
+
      line-height: 1.38;
+
      padding-top: 14px;
+
    }
+
  }
}

                      
.error {
        creationDate={creationDate}
        isIncentivizedTestnet={networkStatus.isIncentivizedTestnet}
        isSubmitting={updateWalletRequest.isExecuting}
+
        isResyncing={false}
        isInvalid={
          updateWalletRequest.wasExecuted &&
          updateWalletRequest.result === false
        onStartEditing={field => startEditingWalletField.trigger({ field })}
        onStopEditing={stopEditingWalletField.trigger}
        onCancelEditing={cancelEditingWalletField.trigger}
+
        onResyncWallet={() => {}}
        activeField={walletFieldBeingEdited}
        nameValidator={name => isValidWalletName(name)}
        changeSpendingPasswordDialog={<ChangeSpendingPasswordDialogContainer />}
  "wallet.settings.recoveryPhraseVerificationNeverOk": "!!!We recommend that you verify your wallet recovery phrase in <b>{timeUntilWarning}</b>",
  "wallet.settings.recoveryPhraseVerificationNeverWarning": "!!!We recommend that you verify your wallet recovery phrase in <b>{timeUntilNotification}</b>.",
  "wallet.settings.recoveryPhraseVerificationTitle": "!!!Do you have your wallet recovery phrase?",
+
  "wallet.settings.resyncWallet.description": "!!!If you are experiencing issues with your wallet, or think you have an incorrect balance or transaction history, you can delete the local data stored by Daedalus and resync with the blockchain.",
+
  "wallet.settings.resyncWallet.header": "!!!Resync wallet with the blockchain",
+
  "wallet.settings.resyncWalletButtonLabel": "!!!Resync wallet",
  "wallet.settings.utxos.description": "!!!This wallet contains <b>{formattedWalletAmount} ADA</b> on <b>{walletUtxosAmount} UTXOs</b> (unspent transaction outputs). Examine the histogram below to see the distribution of UTXOs with different amounts of ada.",
  "wallet.settings.utxos.emptyWallet": "!!!This wallet is empty so it does not contain any UTXOs (unspent transaction outputs).",
  "wallet.settings.utxos.findOutMoreLink": "!!!Find out more",
    ],
    "path": "source/renderer/app/components/wallet/settings/ExportWalletToFileDialog.json"
  },
+
  {
+
    "descriptors": [
+
      {
+
        "defaultMessage": "!!!Resync wallet",
+
        "description": "Label for the resync button on wallet settings",
+
        "end": {
+
          "column": 3,
+
          "line": 14
+
        },
+
        "file": "source/renderer/app/components/wallet/settings/ResyncWalletButton.js",
+
        "id": "wallet.settings.resyncWalletButtonLabel",
+
        "start": {
+
          "column": 9,
+
          "line": 10
+
        }
+
      }
+
    ],
+
    "path": "source/renderer/app/components/wallet/settings/ResyncWalletButton.json"
+
  },
  {
    "descriptors": [
      {
        "description": "Label for the \"Transaction assurance security level\" dropdown.",
        "end": {
          "column": 3,
-
          "line": 25
+
          "line": 26
        },
        "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
        "id": "wallet.settings.assurance",
        "start": {
          "column": 23,
-
          "line": 20
+
          "line": 21
        }
      },
      {
        "defaultMessage": "!!!Delete wallet",
        "description": "Delete wallet header on the wallet settings page.",
        "end": {
          "column": 3,
-
          "line": 30
+
          "line": 31
        },
        "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
        "id": "wallet.settings.deleteWallet.header",
        "start": {
          "column": 22,
-
          "line": 26
+
          "line": 27
        }
      },
      {
        "defaultMessage": "!!!Once you delete this wallet it will be removed from the Daedalus interface and you will lose access to any remaining funds in the wallet. The only way to regain access after deletion is by restoring it using your wallet recovery phrase.",
        "description": "Delete wallet warning explaining the consequences.",
        "end": {
          "column": 3,
-
          "line": 36
+
          "line": 37
        },
        "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
        "id": "wallet.settings.deleteWallet.warning1",
        "start": {
          "column": 24,
-
          "line": 31
+
          "line": 32
        }
      },
      {
        "defaultMessage": "!!!You may wish to verify your recovery phrase before deletion to ensure that you can restore this wallet in the future, if desired.",
        "description": "Delete wallet warning explaining the consequences.",
        "end": {
          "column": 3,
-
          "line": 42
+
          "line": 43
        },
        "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
        "id": "wallet.settings.deleteWallet.warning2",
        "start": {
          "column": 24,
-
          "line": 37
+
          "line": 38
+
        }
+
      },
+
      {
+
        "defaultMessage": "!!!Resync wallet with the blockchain",
+
        "description": "Resync wallet header on the wallet settings page.",
+
        "end": {
+
          "column": 3,
+
          "line": 48
+
        },
+
        "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
+
        "id": "wallet.settings.resyncWallet.header",
+
        "start": {
+
          "column": 22,
+
          "line": 44
+
        }
+
      },
+
      {
+
        "defaultMessage": "!!!If you are experiencing issues with your wallet, or think you have an incorrect balance or transaction history, you can delete the local data stored by Daedalus and resync with the blockchain.",
+
        "description": "Resync wallet description.",
+
        "end": {
+
          "column": 3,
+
          "line": 54
+
        },
+
        "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
+
        "id": "wallet.settings.resyncWallet.description",
+
        "start": {
+
          "column": 27,
+
          "line": 49
        }
      },
      {
        "defaultMessage": "!!!Name",
        "description": "Label for the \"Name\" text input on the wallet settings page.",
        "end": {
          "column": 3,
-
          "line": 47
+
          "line": 59
        },
        "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
        "id": "wallet.settings.name.label",
        "start": {
          "column": 8,
-
          "line": 43
+
          "line": 55
        }
      },
      {
        "defaultMessage": "!!!Password",
        "description": "Label for the \"Password\" field.",
        "end": {
          "column": 3,
-
          "line": 52
+
          "line": 64
        },
        "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
        "id": "wallet.settings.password",
        "start": {
          "column": 17,
-
          "line": 48
+
          "line": 60
        }
      },
      {
        "defaultMessage": "!!!Last updated",
        "description": "Last updated X time ago message.",
        "end": {
          "column": 3,
-
          "line": 57
+
          "line": 69
        },
        "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
        "id": "wallet.settings.passwordLastUpdated",
        "start": {
          "column": 23,
-
          "line": 53
+
          "line": 65
        }
      }
    ],
  "wallet.settings.recoveryPhraseVerificationNeverOk": "We recommend that you verify your wallet recovery phrase in <b>{timeUntilWarning}</b>.",
  "wallet.settings.recoveryPhraseVerificationNeverWarning": "We recommend that you verify your wallet recovery phrase.",
  "wallet.settings.recoveryPhraseVerificationTitle": "Do you have your wallet recovery phrase?",
+
  "wallet.settings.resyncWallet.description": "If you are experiencing issues with your wallet, or think you have an incorrect balance or transaction history, you can delete the local data stored by Daedalus and resync with the blockchain.",
+
  "wallet.settings.resyncWallet.header": "Resync wallet with the blockchain",
+
  "wallet.settings.resyncWalletButtonLabel": "Resync wallet",
  "wallet.settings.utxos.description": "This wallet contains <b>{formattedWalletAmount} ADA</b> on <b>{walletUtxosAmount} UTXOs</b> (unspent transaction outputs). Examine the histogram below to see the distribution of UTXOs with different amounts of ada.",
  "wallet.settings.utxos.emptyWallet": "This wallet is empty so it does not contain any UTXOs (unspent transaction outputs).",
  "wallet.settings.utxos.findOutMoreLink": "Find out more",
  "wallet.settings.recoveryPhraseVerificationNeverOk": "!!!We recommend that you verify your wallet recovery phrase in <b>{timeUntilWarning}</b>",
  "wallet.settings.recoveryPhraseVerificationNeverWarning": "!!!We recommend that you verify your wallet recovery phrase in <b>{timeUntilNotification}</b>.",
  "wallet.settings.recoveryPhraseVerificationTitle": "!!!Do you have your wallet recovery phrase?",
+
  "wallet.settings.resyncWallet.description": "!!!If you are experiencing issues with your wallet, or think you have an incorrect balance or transaction history, you can delete the local data stored by Daedalus and resync with the blockchain.",
+
  "wallet.settings.resyncWallet.header": "!!!Resync wallet with the blockchain",
+
  "wallet.settings.resyncWalletButtonLabel": "!!!Resync wallet",
  "wallet.settings.utxos.description": "!!!This wallet contains <b>{formattedWalletAmount} ADA</b> on <b>{walletUtxosAmount} UTXOs</b> (unspent transaction outputs). Examine the histogram below to see the distribution of UTXOs with different amounts of ada.",
  "wallet.settings.utxos.emptyWallet": "!!!This wallet is empty so it does not contain any UTXOs (unspent transaction outputs).",
  "wallet.settings.utxos.findOutMoreLink": "!!!Find out more",
  "wallet.settings.recoveryPhraseVerificationNeverOk": "ウォレット復元フレーズを<b>{timeUntilWarning}</b>以内に検証してください。",
  "wallet.settings.recoveryPhraseVerificationNeverWarning": "ウォレット復元フレーズを検証してください。",
  "wallet.settings.recoveryPhraseVerificationTitle": "ウォレット復元フレーズをお持ちですか。",
+
  "wallet.settings.resyncWallet.description": "ウォレットに不具合が生じている場合、または残高やトランザクション履歴が不正確であると思われる場合は、Daedalusに保存されたローカルデータを削除してブロックチェーンと再同期することができます。",
+
  "wallet.settings.resyncWallet.header": "ウォレットとブロックチェーンの再同期",
+
  "wallet.settings.resyncWalletButtonLabel": "ウォレットを再同期",
  "wallet.settings.utxos.description": "このウォレットには、<b>{walletUtxosAmount}のUTXO</b>(未使用トランザクションアウトプット)に<b>{formattedWalletAmount}ADA</b>が含まれています。含まれるADAの額ごとのUTXO分布状況は、下のグラフで確認できます。",
  "wallet.settings.utxos.emptyWallet": "このウォレットは空のため、UTXO(未使用トランザクションアウトプット)はありません。",
  "wallet.settings.utxos.findOutMoreLink": "もっと詳しく",
  "wallet.settings.recoveryPhraseVerificationNeverOk": "!!!We recommend that you verify your wallet recovery phrase in <b>{timeUntilWarning}</b>",
  "wallet.settings.recoveryPhraseVerificationNeverWarning": "!!!We recommend that you verify your wallet recovery phrase in <b>{timeUntilNotification}</b>.",
  "wallet.settings.recoveryPhraseVerificationTitle": "!!!Do you have your wallet recovery phrase?",
+
  "wallet.settings.resyncWallet.description": "!!!If you are experiencing issues with your wallet, or think you have an incorrect balance or transaction history, you can delete the local data stored by Daedalus and resync with the blockchain.",
+
  "wallet.settings.resyncWallet.header": "!!!Resync wallet with the blockchain",
+
  "wallet.settings.resyncWalletButtonLabel": "!!!Resync wallet",
  "wallet.settings.utxos.description": "!!!This wallet contains <b>{formattedWalletAmount} ADA</b> on <b>{walletUtxosAmount} UTXOs</b> (unspent transaction outputs). Examine the histogram below to see the distribution of UTXOs with different amounts of ada.",
  "wallet.settings.utxos.emptyWallet": "!!!This wallet is empty so it does not contain any UTXOs (unspent transaction outputs).",
  "wallet.settings.utxos.findOutMoreLink": "!!!Find out more",
  "wallet.settings.recoveryPhraseVerificationNeverOk": "!!!We recommend that you verify your wallet recovery phrase in <b>{timeUntilWarning}</b>",
  "wallet.settings.recoveryPhraseVerificationNeverWarning": "!!!We recommend that you verify your wallet recovery phrase in <b>{timeUntilNotification}</b>.",
  "wallet.settings.recoveryPhraseVerificationTitle": "!!!Do you have your wallet recovery phrase?",
+
  "wallet.settings.resyncWallet.description": "!!!If you are experiencing issues with your wallet, or think you have an incorrect balance or transaction history, you can delete the local data stored by Daedalus and resync with the blockchain.",
+
  "wallet.settings.resyncWallet.header": "!!!Resync wallet with the blockchain",
+
  "wallet.settings.resyncWalletButtonLabel": "!!!Resync wallet",
  "wallet.settings.utxos.description": "!!!This wallet contains <b>{formattedWalletAmount} ADA</b> on <b>{walletUtxosAmount} UTXOs</b> (unspent transaction outputs). Examine the histogram below to see the distribution of UTXOs with different amounts of ada.",
  "wallet.settings.utxos.emptyWallet": "!!!This wallet is empty so it does not contain any UTXOs (unspent transaction outputs).",
  "wallet.settings.utxos.findOutMoreLink": "!!!Find out more",
        type || WalletRecoveryPhraseVerificationTypes.NEVER_CHECKED
      }
      locale={locale}
+
      isResyncing={false}
+
      onResyncWallet={action('onResyncWallet')}
    />
  );
};