-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert config to ES6 #888
Conversation
app/script/config.js
Outdated
// 15 megabyte image upload limit | ||
MAXIMUM_IMAGE_FILE_SIZE: ( | ||
15 * 1024 * 1024 | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MAXIMUM_ASSET_FILE_SIZE: 15 * 1024 * 1024,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes
app/script/config.js
Outdated
'image/gif', | ||
], | ||
|
||
LOCALYTICS_SESSION_TIMEOUT: (3 * 60 * 1000), // 3 minutes in milliseconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for parenthesis
app/script/config.js
Outdated
MINIMUM_PASSWORD_LENGTH: 8, | ||
|
||
// Time until phone code expires | ||
LOGIN_CODE_EXPIRATION: (10 * 60), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for parenthesis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it makes it more readable.
app/script/config.js
Outdated
|
||
'use strict'; | ||
|
||
if (window.z === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ==
instead of ===
(to include undefined
)
app/script/config.js
Outdated
PURPLE: 7, | ||
}, | ||
|
||
// Conversation size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless comment
app/script/config.js
Outdated
// Conversation size | ||
MAXIMUM_CONVERSATION_SIZE: 128, | ||
|
||
// self profile image size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it useless? The variable describes only a minimum profile image size, the comment explains that it is about the user's self profile image.
// Maximum of parallel uploads | ||
MAXIMUM_ASSET_UPLOADS: 10, | ||
|
||
// Maximum characters per message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless comment, the constant is self explanatory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because it explains that the length is measured in characters, not in bytes or anything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we have to update the constant to MAXIMUM_MESSAGE_CHARACTERS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or something similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constant renaming comes in another PR...
app/script/config.js
Outdated
// 25 megabyte upload limit ( minus iv and padding ) | ||
MAXIMUM_ASSET_FILE_SIZE: 25 * 1024 * 1024 - 16 - 16, | ||
|
||
// Maximum of parallel uploads |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless comment, the constant is self explanatory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what iv
means.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not self-explanatory. The variable describes only a maximum of any asset uploads, the comment describes that it is about parallel uploads.
MINIMUM_PASSWORD_LENGTH: 8, | ||
|
||
// 10 seconds until phone code expires | ||
LOGIN_CODE_EXPIRATION: 10 * 60, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's 10 seconds.. why it's multiplied by 60?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who knows? 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usage of this code is @code_expiration_timestamp z.util.get_unix_timestamp() + z.config.LOGIN_CODE_EXPIRATION
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's definitely 10 minutes - comment is wrong
Type of change
Screenshot