mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 03:11:38 +03:00
discarded generateUUid in favour of author permlink mix
This commit is contained in:
parent
1b5e640e76
commit
2c9905626c
@ -121,7 +121,7 @@ const PostCardView = ({
|
||||
const height =
|
||||
(evt.nativeEvent.height / evt.nativeEvent.width) * (dim.width - 18);
|
||||
setCalcImgHeight(height);
|
||||
setImageHeight(content.local_id, height);
|
||||
setImageHeight(content.author + content.permlink, height);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
@ -75,7 +75,7 @@ const postsListContainer = ({
|
||||
if (get(p, 'author', null) && posts.filter((x) => x.permlink === p.permlink).length <= 0) {
|
||||
|
||||
//get image height from cache if available
|
||||
const localId = p.local_id;
|
||||
const localId = p.author + p.permlink;
|
||||
const imgHeight = imageHeights.get(localId)
|
||||
|
||||
e.push(
|
||||
@ -92,7 +92,7 @@ const postsListContainer = ({
|
||||
}
|
||||
if (get(item, 'author', null)) {
|
||||
//get image height from cache if available
|
||||
const localId = item.local_id
|
||||
const localId = item.author + item.permlink;
|
||||
const imgHeight = imageHeights.get(localId)
|
||||
|
||||
e.push(
|
||||
|
@ -1,20 +0,0 @@
|
||||
export default ({short}:{short:boolean} = {short:false}): string => {
|
||||
var d = new Date().getTime(); //Timestamp
|
||||
var d2 = 0;
|
||||
const variant = short
|
||||
? 'xxxx-4xxx-yxxx'
|
||||
: 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
|
||||
return variant.replace(/[xy]/g, function (c) {
|
||||
var r = Math.random() * 16; //random number between 0 and 16
|
||||
if (d > 0) {
|
||||
//Use timestamp until depleted
|
||||
r = (d + r) % 16 | 0;
|
||||
d = Math.floor(d / 16);
|
||||
} else {
|
||||
//Use microseconds since page-load if supported
|
||||
r = (d2 + r) % 16 | 0;
|
||||
d2 = Math.floor(d2 / 16);
|
||||
}
|
||||
return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);
|
||||
});
|
||||
};
|
@ -9,7 +9,6 @@ import FastImage from 'react-native-fast-image';
|
||||
import parseAsset from './parseAsset';
|
||||
import { getReputation } from './reputation';
|
||||
import { getResizedAvatar, getResizedImage } from './image';
|
||||
import generateUuid from './generateUuid';
|
||||
|
||||
const webp = Platform.OS === 'ios' ? false : true;
|
||||
|
||||
@ -26,8 +25,6 @@ export const parsePost = (post, currentUserName, isPromoted, isList = false) =>
|
||||
return null;
|
||||
}
|
||||
|
||||
post.local_id = generateUuid({ short: true });
|
||||
|
||||
if (currentUserName === post.author) {
|
||||
post.markdownBody = post.body;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user