Skip to content

Commit

Permalink
Issue #27 - try another way to run getPermalinkParts and getCurrentPo…
Browse files Browse the repository at this point in the history
…stType. Try adding key to Fragment around dt and dd tags
  • Loading branch information
bobbingwide committed May 27, 2019
1 parent 3a6edcf commit a8b9ab4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions blocks/oik-blocklist/blocklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,19 @@ function namespaceFilter( element, index, array ) {
var blockName = block.name.replace( '/', '-' );
var blockLink = null;
var prefix = null;
const { getCurrentPostType, getPermalinkParts } = select('core/editor' );
//const { getCurrentPostType, getPermalinkParts } = select('core/editor' );
//console.log(getCurrentPostType());
var siteurl = getPermalinkParts();
var siteurl = select('core/editor').getPermalinkParts();

if ( siteurl !== null ) {

console.log(siteurl);
console.log(getCurrentPostType());
var postType = select( 'core/editor').getCurrentPostType();
console.log( postType );

prefix = siteurl.prefix.replace(getCurrentPostType(), 'block');
prefix = siteurl.prefix.replace( postType, 'block');
} else {
console.log( "SiteURL's null");
}

//alert( "hey");
Expand All @@ -94,8 +97,8 @@ function BlockListItem( block, showBlockLink ) {
blockLink = getBlockLink( block );
}

return( <Fragment>
<dt>
return( <Fragment key={block.name}>
<dt >
<BlockIcon icon={block.icon.src} />
</dt>

Expand Down

0 comments on commit a8b9ab4

Please sign in to comment.