Skip to content

Commit

Permalink
🐛 Fix cannot update iscn without timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Aug 18, 2023
1 parent e43646e commit a6acc65
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion likecoin/assets/js/admin-metabox/metabox.asset.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php return array(
'dependencies' => array(),
'version' => 'fb5d57ee5a1b3a94c07a',
'version' => '52988637c6cc94d5f64b',
);
2 changes: 1 addition & 1 deletion likecoin/assets/js/admin-metabox/metabox.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion likecoin/assets/js/sidebar/index.asset.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php return array(
'dependencies' => array( 'react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-wordcount' ),
'version' => 'fc2ec40825e2401de656',
'version' => 'cd6f88cb1cd5682ed03d',
);
2 changes: 1 addition & 1 deletion likecoin/assets/js/sidebar/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion likecoin/js/admin-metabox/metabox.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function onRefreshPublishStatus(e) {
iscnId,
isMattersPublished,
lastModifiedTime,
iscnTimestamp,
iscnTimestamp = 0,
} = lcPostInfo;
const res = await jQuery.ajax({
type: 'POST',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ function LikeCoinPluginDocumentSettingPanel(props) {
const postDate = useSelect((select) => select('core/editor').getEditedPostAttribute('modified_gmt'));
useEffect(() => {
setShowUpdateISCNButton(!!(isCurrentPostPublished
&& props.ISCNTimestamp
&& Date.parse(`${postDate}Z`) > props.ISCNTimestamp)); // force parsing as gmt;
&& Date.parse(`${postDate}Z`) > (props.ISCNTimestamp || 0))); // force parsing as gmt;
}, [isCurrentPostPublished, postDate, props.ISCNTimestamp]);
useEffect(() => setShowNFTButton(!!props.ISCNId), [props.ISCNId]);
useEffect(() => {
Expand Down
3 changes: 1 addition & 2 deletions likecoin/js/sidebar/src/pages/LikeCoinPluginSideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ function LikeCoinPluginSideBar(props) {
}, [isCurrentPostPublished, props.ISCNId]);
useEffect(() => {
setShowUpdateISCNButton(!!(isCurrentPostPublished
&& props.ISCNTimestamp
&& Date.parse(`${postDate}Z`) > props.ISCNTimestamp)); // force parsing as gmt
&& Date.parse(`${postDate}Z`) > (props.ISCNTimestamp || 0))); // force parsing as gmt
}, [isCurrentPostPublished, postDate, props.ISCNTimestamp]);
useEffect(() => setShowNFTButton(!!props.ISCNId), [props.ISCNId]);
useEffect(() => {
Expand Down

0 comments on commit a6acc65

Please sign in to comment.