mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-05 04:28:03 +03:00
permlink generation update
This commit is contained in:
parent
8a32ff7388
commit
81abe3275c
@ -16,9 +16,15 @@ export const generatePermlink = (title, random = false) => {
|
|||||||
let perm = slug && slug.toString();
|
let perm = slug && slug.toString();
|
||||||
|
|
||||||
if (title) {
|
if (title) {
|
||||||
|
// make shorter url if possible
|
||||||
|
let shortp = perm.split('-');
|
||||||
|
if (shortp.length > 5) {
|
||||||
|
perm = shortp.slice(0, 5).join('-');
|
||||||
|
}
|
||||||
|
|
||||||
if (random) {
|
if (random) {
|
||||||
const rnd = (Math.random() + 1).toString(16).substring(2);
|
const rnd = permlinkRnd();
|
||||||
perm = `${slug.toString()}${rnd}est`;
|
perm = `${perm}-${rnd}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STEEMIT_MAX_PERMLINK_LENGTH
|
// STEEMIT_MAX_PERMLINK_LENGTH
|
||||||
|
Loading…
Reference in New Issue
Block a user