@@ -119,7 +118,14 @@ async function universalRender({ location, initial_state, offchain, ErrorPage, t
...
@@ -119,7 +118,14 @@ async function universalRender({ location, initial_state, offchain, ErrorPage, t
if (url.indexOf('/curation-rewards')!==-1)url=url.replace(/\/curation-rewards$/,'/transfers');
if (url.indexOf('/curation-rewards')!==-1)url=url.replace(/\/curation-rewards$/,'/transfers');
if (url.indexOf('/author-rewards')!==-1)url=url.replace(/\/author-rewards$/,'/transfers');
if (url.indexOf('/author-rewards')!==-1)url=url.replace(/\/author-rewards$/,'/transfers');
onchain=awaitapi.getStateAsync(url);
try{
onchain=awaitredis.get(url);
}catch (error){
}
if (!onchain){
onchain=awaitapi.getStateAsync(url);
redis.set(url,onchain);
}
if (Object.getOwnPropertyNames(onchain.accounts).length===0&&(url.match(routeRegex.UserProfile1)||url.match(routeRegex.UserProfile3))){// protect for invalid account
if (Object.getOwnPropertyNames(onchain.accounts).length===0&&(url.match(routeRegex.UserProfile1)||url.match(routeRegex.UserProfile3))){// protect for invalid account
return{
return{
...
@@ -141,7 +147,16 @@ async function universalRender({ location, initial_state, offchain, ErrorPage, t
...
@@ -141,7 +147,16 @@ async function universalRender({ location, initial_state, offchain, ErrorPage, t
if (!url.match(routeRegex.PostsIndex)&&!url.match(routeRegex.UserProfile1)&&!url.match(routeRegex.UserProfile2)&&url.match(routeRegex.PostNoCategory)){
if (!url.match(routeRegex.PostsIndex)&&!url.match(routeRegex.UserProfile1)&&!url.match(routeRegex.UserProfile2)&&url.match(routeRegex.PostNoCategory)){