Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13114971
D11332.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D11332.diff
View Options
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
Details
Attached
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)
Attached To
D11332: [Cashtab] Replace hardcoded length limit with settings param
Event Timeline
Log In to Comment