Page MenuHomePhabricator

D11332.diff
No OneTemporary

D11332.diff

diff --git a/web/cashtab/src/components/Common/Ticker.js b/web/cashtab/src/components/Common/Ticker.js
--- a/web/cashtab/src/components/Common/Ticker.js
+++ b/web/cashtab/src/components/Common/Ticker.js
@@ -28,6 +28,7 @@
defaultSettings: { fiatCurrency: 'usd', sendModal: false },
notificationDurationShort: 3,
notificationDurationLong: 5,
+ localStorageMaxCharacters: 24,
newTokenDefaultUrl: 'https://cashtab.com/',
opReturn: {
opReturnPrefixHex: '6a',
diff --git a/web/cashtab/src/components/Configure/Configure.js b/web/cashtab/src/components/Configure/Configure.js
--- a/web/cashtab/src/components/Configure/Configure.js
+++ b/web/cashtab/src/components/Configure/Configure.js
@@ -52,6 +52,7 @@
import { formatSavedBalance } from 'utils/formatting';
import { isValidXecAddress } from 'utils/validation';
+import { currency } from 'components/Common/Ticker.js';
const { Panel } = Collapse;
const SettingsLink = styled.a`
@@ -694,7 +695,10 @@
};
const changeWalletName = async () => {
- if (newWalletName === '' || newWalletName.length > 24) {
+ if (
+ newWalletName === '' ||
+ newWalletName.length > currency.localStorageMaxCharacters
+ ) {
setNewWalletNameIsValid(false);
return;
}
@@ -758,7 +762,11 @@
const handleWalletNameInput = e => {
const { value } = e.target;
// validation
- if (value && value.length && value.length < 24) {
+ if (
+ value &&
+ value.length &&
+ value.length <= currency.localStorageMaxCharacters
+ ) {
setNewWalletNameIsValid(true);
} else {
setNewWalletNameIsValid(false);
@@ -797,7 +805,11 @@
const handleContactNameInput = e => {
const { value } = e.target;
- if (value && value.length && value.length < 24) {
+ if (
+ value &&
+ value.length &&
+ value.length < currency.localStorageMaxCharacters
+ ) {
setNewContactNameIsValid(true);
} else {
setNewContactNameIsValid(false);

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 1, 08:59 (10 m, 8 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187146
Default Alt Text
D11332.diff (2 KB)

Event Timeline