-
-
-
-
-
-
-
-
-
-
- {item.msg}
-
-
- {moment(`${item.date}Z`).local().fromNow()}
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+ {item.msg}
+
+ {moment(`${item.date}Z`).local().fromNow()}
+
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
))}
- {(!loading && notifications.length === 0) &&
- (
You have no notifications )}
+ {(!loading && notifications.length === 0) &&
You have no notifications }
)
@@ -274,6 +368,7 @@ const mapStateToProps = (state) => ({
const mapDispatchToProps = (dispatch) => ({
...bindActionCreators({
setPageFrom,
+ filterNotificationRequest,
}, dispatch),
})
diff --git a/src/components/pages/Profile/index.js b/src/components/pages/Profile/index.js
index 4daa7f81f..671bf1142 100644
--- a/src/components/pages/Profile/index.js
+++ b/src/components/pages/Profile/index.js
@@ -935,7 +935,7 @@ const Profile = (props) => {
{!loading && !ceramic &&
}
{!loading && !ceramic &&
-
}
+
}
{!loading && !ceramic &&
}
diff --git a/src/components/sections/WalletBalances/index.js b/src/components/sections/WalletBalances/index.js
index 6ac73e6d0..0242e2113 100644
--- a/src/components/sections/WalletBalances/index.js
+++ b/src/components/sections/WalletBalances/index.js
@@ -61,14 +61,14 @@ const useStyles = createUseStyles(theme => ({
fontSize: 14,
},
value : {
- fontWeight: 'bold',
+ fontWeight: 'medium',
paddingRight: 5,
marginTop: 0,
marginBottom: 0,
paddingTop: 0,
paddingBottom: 0,
- color: '#e61c34',
textAlign: 'end',
+ ...theme.hiveValuesFont,
},
circle: {
strokeLinecap: 'round',
diff --git a/src/routes.js b/src/routes.js
index 8b145499d..4aa5b3191 100644
--- a/src/routes.js
+++ b/src/routes.js
@@ -83,6 +83,11 @@ const routes = [
exact: true,
component: Trending,
},
+ {
+ path: '/messages',
+ exact: true,
+ component: Trending,
+ },
{
path: '/latest',
exact: true,
diff --git a/src/services/api.js b/src/services/api.js
index 4015b6a91..33449babc 100644
--- a/src/services/api.js
+++ b/src/services/api.js
@@ -1,16 +1,21 @@
-import {api, auth, broadcast, formatter} from '@hiveio/hive-js'
+import {
+ api,
+ auth,
+ broadcast,
+ formatter,
+} from '@hiveio/hive-js'
import {hash} from '@hiveio/hive-js/lib/auth/ecc'
import {Promise, reject} from 'bluebird'
import {v4 as uuidv4} from 'uuid'
import appConfig from 'config'
-import config from 'config'
import axios from 'axios'
import getSlug from 'speakingurl'
import moment from 'moment'
import {ChainTypes, makeBitMaskFilter} from '@hiveio/hive-js/lib/auth/serializer'
import 'react-app-polyfill/stable'
import {calculateOverhead, stripHtml} from 'services/helper'
-import {hacManualTransaction, hacUserAuth, hacVote} from "@mintrawa/hive-auth-client"
+import {hacUserAuth, hacVote, hacManualTransaction} from "@mintrawa/hive-auth-client"
+import config from 'config'
const searchUrl = `${appConfig.SEARCH_API}/search`
const scrapeUrl = `${appConfig.SCRAPE_API}/scrape`
@@ -31,9 +36,9 @@ const visited = []
const defaultNode = process.env.REACT_APP_DEFAULT_RPC_NODE
export const geRPCNode = () => {
- return new Promise((resolve) => {
- if (localStorage.getItem('rpc-setting')) {
- if (localStorage.getItem('rpc-setting') !== 'default') {
+ return new Promise( (resolve) => {
+ if(localStorage.getItem('rpc-setting')) {
+ if(localStorage.getItem('rpc-setting') !== 'default') {
const node = localStorage.getItem('rpc-setting')
resolve(node)
} else {
@@ -70,7 +75,7 @@ export const invokeFilter = (item) => {
}
export const removeFootNote = (data) => {
- if (typeof data !== 'string') {
+ if(typeof data !== 'string') {
return data.forEach((item) => {
item.body = item.body.replace('
Posted via
D.Buzz ', '')
item.body = item.body.replace('
Posted via
D.Buzz ', '')
@@ -109,21 +114,32 @@ export const callBridge = async (method, params, appendParams = true) => {
export const searchPeople = (username) => {
return new Promise((resolve, reject) => {
- fetchSingleProfile(username)
- .then((response) => {
- const profile = response
- profile.reputations = [
- {
- account: profile.name,
- reputation: profile.reputation,
- },
- ]
-
- resolve(profile)
- })
- .catch((err) => {
+ const params = {account_lower_bound: username, limit: 30}
+
+ api.call('reputation_api.get_account_reputations', params, async (err, data) => {
+ if (err) {
+ console.log('error', err)
reject(err)
- })
+ } else {
+
+ if (data.reputations.length !== 0) {
+ data.reputations.forEach((item, index) => {
+ let score = item.reputation ? formatter.reputation(item.reputation) : 25
+ if (!score || score < 25) {
+ score = 25
+ }
+ data.reputations[index].repscore = score
+ data.reputations[index].author = item.account
+ })
+
+ const getProfiledata = mapFetchProfile(data.reputations)
+ await Promise.all([getProfiledata])
+ }
+
+ resolve(data)
+ }
+ })
+
})
}
@@ -414,7 +430,7 @@ export const fetchProfile = (username, checkFollow = false) => {
return new Promise((resolve, reject) => {
api.getAccountsAsync(username)
.then(async (result) => {
- if (result.length === 0) resolve(result)
+ if(result.length === 0) resolve(result)
result.forEach(async (item, index) => {
const repscore = item.reputation
let score = formatter.reputation(repscore)
@@ -817,7 +833,6 @@ export const publishPostWithHAS = async (user, body, tags, payout, perm) => {
const permlink = perm ? perm : createPermlink(title)
const operations = await hasGeneratePostService(user.username, title, tags, body, payout, permlink)
- console.log(operations)
hasPostService(operations[0])
const comment = operations[0]
const json_metadata = comment[1].json_metadata
@@ -1477,11 +1492,54 @@ export const createMeta = (tags = []) => {
return JSON.stringify(meta)
}
-export const createPermlink = (title) => {
- const permlink = new Array(22).join().replace(/(.|$)/g, function () {
- return ((Math.random() * 36) | 0).toString(36)
+const STOP_WORDS = new Set([
+ "a", "about", "actually", "almost", "also", "although", "always", "am", "an",
+ "and", "any", "are", "as", "at", "be", "became", "become", "but", "by", "can",
+ "could", "did", "do", "does", "each", "either", "else", "for", "from", "had",
+ "has", "have", "hence", "how", "i", "if", "in", "is", "it", "its", "just", "may",
+ "maybe", "me", "might", "mine", "must", "my", "neither", "nor", "not", "of", "oh",
+ "ok", "when", "where", "whereas", "wherever", "whenever", "whether", "which", "while",
+ "who", "whom", "whoever", "whose", "why", "will", "with", "within", "without", "would",
+ "yes", "yet", "you", "your",
+])
+
+function sanitizeTitle(title) {
+ return title.replace(/[^a-zA-Z0-9\s]/g, '')
+}
+
+function generateSeoFriendlyPermalink(title) {
+ const words = title.split(' ').filter(word => {
+ const lowercased = word.toLowerCase()
+ return !STOP_WORDS.has(lowercased) && lowercased.length > 1
})
- return permlink
+ return words.join('-').toLowerCase()
+}
+
+const MAX_CHARS = 20
+
+function truncatePermlink(permlink) {
+ let truncated = permlink.substring(0, MAX_CHARS)
+ while (truncated.endsWith('-')) {
+ truncated = truncated.slice(0, -1)
+ }
+ return truncated
+}
+
+function generateRandomString(length) {
+ return Array.from({ length }, () => (Math.random() * 36 | 0).toString(36)).join('')
+}
+
+export const createPermlink = (title) => {
+ const sanitizedTitle = sanitizeTitle(title)
+ let seoFriendlyPermlink = generateSeoFriendlyPermalink(sanitizedTitle)
+
+ if (seoFriendlyPermlink.length > MAX_CHARS) {
+ seoFriendlyPermlink = truncatePermlink(seoFriendlyPermlink)
+ }
+
+ return seoFriendlyPermlink.length >= MAX_CHARS
+ ? seoFriendlyPermlink
+ : generateRandomString(MAX_CHARS)
}
@@ -1535,22 +1593,27 @@ export const searchPostAuthor = (author) => {
export const searchPostGeneral = (query) => {
return new Promise(async (resolve, reject) => {
// const body = {query}
- const {tag, sort} = query
+ const { tag , sort } = query
axios({
method: 'POST',
url: `${searchUrl}/query`,
data: {
- query: tag,
- sort: sort,
+ query : tag,
+ sort : sort,
},
}).then(async (result) => {
const data = result.data
if (data.results.length !== 0) {
+ console.log(data.results)
const getProfiledata = mapFetchProfile(data.results, false)
await Promise.all([getProfiledata])
+ data.results = data.results.filter((item) =>
+ item.body.length <= 280 && !item.permlink.startsWith('re-'),
+ )
+
removeFootNote(data.results)
- data.results = data.results.filter((item) => item.body.length <= 280)
+
}
resolve(data)
@@ -1574,8 +1637,8 @@ export const checkIfImage = (links) => {
export const uploadImage = async (data, progress) => {
const formData = new FormData()
- formData.append('file', data)
-
+ formData.append('file', data, data.name)
+ formData.append('customFileName', data.name)
return new Promise(async (resolve, reject) => {
try {
const response = await axios({
@@ -1596,9 +1659,9 @@ export const uploadImage = async (data, progress) => {
reject(error)
}
})
-
}
+
export const uploadVideo = async (data, username, progress) => {
const formData = new FormData()
formData.append('username', username)
@@ -1745,7 +1808,6 @@ export const generateClaimRewardOperation = (account, reward_hive, reward_hbd, r
export const getEstimateAccountValue = (account) => {
return new Promise(async (resolve) => {
- console.log(account)
await formatter.estimateAccountValue(account)
.catch(function (err) {
console.log(err)
diff --git a/src/services/theme.js b/src/services/theme.js
index 00fca1017..44f7f9a5c 100644
--- a/src/services/theme.js
+++ b/src/services/theme.js
@@ -67,6 +67,9 @@ const night = {
font: {
color: 'rgb(255, 255, 255) !important',
},
+ hiveValuesFont: {
+ color: 'white !important',
+ },
textIcon : {
color: 'rgb(136, 153, 166)',
},
@@ -248,6 +251,9 @@ const light = {
font: {
color: 'black !important',
},
+ hiveValuesFont: {
+ color: 'black !important',
+ },
border: {
primary: '1px solid #e6ecf0',
thick: '10px solid #e6ecf0',
From ccdb01b986514b8df75ba2d9349b026c3e5f3ef2 Mon Sep 17 00:00:00 2001
From: Aashir Shaikh <70917922+aaashir@users.noreply.github.com>
Date: Thu, 14 Dec 2023 06:19:36 +0500
Subject: [PATCH 02/11] release 3.64.1 (with fixes) (#1207)
---
src/components/common/HelmetGenerator/index.js | 2 +-
src/components/layout/MobileAppFrame/index.js | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/components/common/HelmetGenerator/index.js b/src/components/common/HelmetGenerator/index.js
index 4e1f039e0..d14b3c1eb 100644
--- a/src/components/common/HelmetGenerator/index.js
+++ b/src/components/common/HelmetGenerator/index.js
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react'
import { Helmet } from 'react-helmet'
import removeMd from 'remove-markdown'
-import { parseUrls, stripHtml } from 'services/helper'
+import { stripHtml } from 'services/helper'
const HelmetGenerator = (props) => {
const {content, user, page = 'content'} = props
diff --git a/src/components/layout/MobileAppFrame/index.js b/src/components/layout/MobileAppFrame/index.js
index 8443116af..0daee1014 100644
--- a/src/components/layout/MobileAppFrame/index.js
+++ b/src/components/layout/MobileAppFrame/index.js
@@ -1124,9 +1124,6 @@ const MobileAppFrame = (props) => {
}
}
- const showNotificationForMessage = () => {
- broadcastNotification('success', 'Coming soon')
- }
// eslint-disable-next-line
useEffect(() => {
if (is_authenticated) {
From 6af1fa9291eea89217bcd0efd261cf5eb528df12 Mon Sep 17 00:00:00 2001
From: Aashir Shaikh
Date: Fri, 15 Dec 2023 01:54:29 +0500
Subject: [PATCH 03/11] hotfix: buzz button widget and profile pic issue
---
.env.development | 2 +-
public/buzzWidget.js | 2 +-
public/widgets/buzzWidget.js | 6 +++---
public/widgets/buzz_button.html | 6 +++---
src/components/elements/Images/Avatar/index.js | 4 ++--
src/components/pages/Developers/index.js | 2 +-
src/components/sections/CreateBuzzForm/index.js | 2 +-
7 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/.env.development b/.env.development
index 5792f7d92..09eb65746 100644
--- a/.env.development
+++ b/.env.development
@@ -1,4 +1,4 @@
-REACT_APP_VERSION=3.64.1-dev
+REACT_APP_VERSION=3.64.2-dev
REACT_APP_SEARCH_API=https://endpoint.d.buzz/api/v1
REACT_APP_SCRAPE_API=https://endpoint.d.buzz/api/v1/meta
REACT_APP_IMAGE_API=https://us-central1-dbuzz-3a79e.cloudfunctions.net/uploadImageEndpoint
diff --git a/public/buzzWidget.js b/public/buzzWidget.js
index 8c6fc5caf..4cf79435f 100644
--- a/public/buzzWidget.js
+++ b/public/buzzWidget.js
@@ -1 +1 @@
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).__dbuzzwidget=e()}(this,function(){"use strict";const A=window.document;const t=new function(){var o="dbuzz-share-button",e=/d\.buzz\/#\/intent\/buzz/;this.i=function(){var e=A.getElementsByClassName(o);for(let t=e.length;t--;)n(e[t],t)};const n=function(t,e){const n=h("iframe");var i=f(t),r="https://d.buzz/widgets/buzz_button.html#"+s(t,e);let u="position: static; visibility: visible;";u+="l"===i?"width: 76px; height: 28px;":"width: 60px; height: 20px;",n.setAttribute("id","dbuzz-widget-"+e),n.setAttribute("title","Dbuzz share button"),n.setAttribute("class",o),n.setAttribute("allowtransparency",!0),n.setAttribute("scrolling","no"),n.setAttribute("frameBorder",0),n.setAttribute("style",u),n.setAttribute("src",r),t.parentNode.insertBefore(n,t),t.remove()},s=function(t,e){t={original_referrer:b(location.href),id:"dbuzz-widget-"+e,text:b(a(t)),size:f(t),url:b(c(t)),tags:m(l(t).trim(),"#",""),min_chars:parseInt(d(t)),origin_app_name:u()};let n="",i=[],r=0;return Object.entries(t).forEach(function(t){var[e,t]=t;t&&(n&&(n+="&"),n+=e+"={"+r+"}",i.push(t),r++)}),g(n,i)};function i(t,e){let n="";return(t=r(t,"href"))&&(t=(t=w(t))?t.input:"",(t=z(p(t)))&&t[e]&&(n=t[e])),n}const u=function(){return A.title||location.hostname||"The site/app you are buzzing from"},c=function(t){return i(t,"url")||r(t,"data-url")||location.href||""},a=function(t){return i(t,"text")||r(t,"data-text")||""},f=function(t){let e=i(t,"size")||r(t,"data-size")||"medium";return e=e.toLowerCase(),"large"==e||"medium"==e?e.charAt(0):"m"},l=function(t){return i(t,"tags")||r(t,"data-hashtags")||""},d=function(t){return i(t,"min_chars")||r(t,"data-min-chars")||0},h=function(t){return A.createElement(t)},r=function(t,e){return t.getAttribute(e)},p=function(t){t=t&&t.split("?");return 2===t.length?t[1]:""},b=function(t){return encodeURIComponent(t)},m=function(t,e,n){return t?t.replace(e,n):""},z=function(t){let i={};return t?(t.split("&").forEach(function(t){var e=t.split("="),n=e[0],t=e[1];2===e.length&&(i[n]=decodeURIComponent(t))}),i):{}},g=function(t,n){return t.replace(/\{(\d+)\}/g,function(t,e){return n[e]||t})},w=function(t){return t.match(e)}};return t.i(),{init:function(){t.i()}}});
\ No newline at end of file
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).__dbuzzwidget=e()}(this,function(){"use strict";const A=window.document;const t=new function(){var o="dbuzz-share-button",e=/d\.buzz\/intent\/buzz/;this.i=function(){var e=A.getElementsByClassName(o);for(let t=e.length;t--;)n(e[t],t)};const n=function(t,e){const n=h("iframe");var i=f(t),r="https://d.buzz/widgets/buzz_button.html#"+s(t,e);let u="position: static; visibility: visible;";u+="l"===i?"width: 76px; height: 28px;":"width: 60px; height: 20px;",n.setAttribute("id","dbuzz-widget-"+e),n.setAttribute("title","Dbuzz share button"),n.setAttribute("class",o),n.setAttribute("allowtransparency",!0),n.setAttribute("scrolling","no"),n.setAttribute("frameBorder",0),n.setAttribute("style",u),n.setAttribute("src",r),t.parentNode.insertBefore(n,t),t.remove()},s=function(t,e){t={original_referrer:b(location.href),id:"dbuzz-widget-"+e,text:b(a(t)),size:f(t),url:b(c(t)),tags:m(l(t).trim(),"#",""),min_chars:parseInt(d(t)),origin_app_name:u()};let n="",i=[],r=0;return Object.entries(t).forEach(function(t){var[e,t]=t;t&&(n&&(n+="&"),n+=e+"={"+r+"}",i.push(t),r++)}),g(n,i)};function i(t,e){let n="";return(t=r(t,"href"))&&(t=(t=w(t))?t.input:"",(t=z(p(t)))&&t[e]&&(n=t[e])),n}const u=function(){return A.title||location.hostname||"The site/app you are buzzing from"},c=function(t){return i(t,"url")||r(t,"data-url")||location.href||""},a=function(t){return i(t,"text")||r(t,"data-text")||""},f=function(t){let e=i(t,"size")||r(t,"data-size")||"medium";return e=e.toLowerCase(),"large"==e||"medium"==e?e.charAt(0):"m"},l=function(t){return i(t,"tags")||r(t,"data-hashtags")||""},d=function(t){return i(t,"min_chars")||r(t,"data-min-chars")||0},h=function(t){return A.createElement(t)},r=function(t,e){return t.getAttribute(e)},p=function(t){t=t&&t.split("?");return 2===t.length?t[1]:""},b=function(t){return encodeURIComponent(t)},m=function(t,e,n){return t?t.replace(e,n):""},z=function(t){let i={};return t?(t.split("&").forEach(function(t){var e=t.split("="),n=e[0],t=e[1];2===e.length&&(i[n]=decodeURIComponent(t))}),i):{}},g=function(t,n){return t.replace(/\{(\d+)\}/g,function(t,e){return n[e]||t})},w=function(t){return t.match(e)}};return t.i(),{init:function(){t.i()}}});
\ No newline at end of file
diff --git a/public/widgets/buzzWidget.js b/public/widgets/buzzWidget.js
index 50fe1c36a..b65fc685b 100644
--- a/public/widgets/buzzWidget.js
+++ b/public/widgets/buzzWidget.js
@@ -15,7 +15,7 @@
const resourceBaseUrl = "https://d.buzz";
const buzzButtonHtmlPath = "/widgets/buzz_button.html";
const dbuzzShareClass = "dbuzz-share-button";
- const intentUrlRegex = /d\.buzz\/#\/intent\/buzz/
+ const intentUrlRegex = /d\.buzz\/intent\/buzz/
/**
@@ -32,7 +32,7 @@
const ifrm = createElement("iframe");
const size = getSize(el);
const args = getSource(el, i);
- const source = resourceBaseUrl + buzzButtonHtmlPath + "#" + args;
+ const source = resourceBaseUrl + buzzButtonHtmlPath + '#' + args;
let style = "position: static; visibility: visible;";
if (size === 'l') {
style = style + 'width: 76px; height: 28px;';
@@ -179,4 +179,4 @@
__dbuzzwidget.i();
}
};
-}));
+}));
\ No newline at end of file
diff --git a/public/widgets/buzz_button.html b/public/widgets/buzz_button.html
index 1985b712d..f36a327b5 100644
--- a/public/widgets/buzz_button.html
+++ b/public/widgets/buzz_button.html
@@ -12,18 +12,18 @@
-