Skip to content

Commit

Permalink
Bugfig autorefresh
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoensing committed Feb 7, 2024
1 parent 0666d03 commit ef84286
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/block.json",
"apiVersion": 2,
"name": "simpletoc/toc",
"version": "6.3.0",
"version": "6.3.2",
"title": "SimpleTOC",
"category": "layout",
"icon": "<svg clip-rule='evenodd' fill-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='2' viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'><path d='m365.983 78.248c2.72-32.415 29.921-57.908 63.029-57.908 34.91 0 63.253 28.342 63.253 63.252s-28.343 63.252-63.253 63.252v269.582c0 25.232-20.485 45.718-45.718 45.718h-313.62c-25.233 0-45.719-20.486-45.719-45.718v-292.46c0-25.233 20.486-45.718 45.719-45.718z' fill='#070D0D'/><g fill='#fff'><path d='m423.898 112.744v-24.188h-24.008v-10.108h24.008v-24.008h10.229v24.008h24.008v10.108h-24.008v24.188z'/><path d='m120.04 403.105c-16.883 0-30.511-13.719-30.511-30.714 0-16.79 13.628-30.714 30.511-30.714 16.679 0 30.511 13.924 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714z'/><path d='m170.891 362.153h183.063v20.476h-183.063z'/><path d='m120.04 300.725c-16.883 0-30.511-13.719-30.511-30.714 0-16.79 13.628-30.714 30.511-30.714 16.679 0 30.511 13.924 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714z'/><path d='m170.891 259.773h183.063v20.476h-183.063z'/><path d='m120.04 198.345c-16.883 0-30.511-13.719-30.511-30.714 0-16.791 13.628-30.714 30.511-30.714 16.679 0 30.511 13.923 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714z'/><path d='m170.891 157.393h183.063v20.476h-183.063z'/></g></svg>",
Expand Down
2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '94f22d7c390e2dee9f8b');
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => 'd8d5b1bfb84a5962113f');
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simpletoc",
"version": "6.3.0",
"version": "6.3.2",
"author": "Marc Tönsing",
"description": "SEO-friendly Table of Contents Gutenberg block. No JavaScript and no CSS means faster loading.",
"main": "build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: SimpleTOC - Table of Contents Block
* Plugin URI: https://marc.tv/simpletoc-wordpress-inhaltsverzeichnis-plugin-gutenberg/
* Description: SEO-friendly Table of Contents Gutenberg block. No JavaScript and no CSS means faster loading.
* Version: 6.3.1
* Version: 6.3.2
* Author: Marc Tönsing
* Author URI: https://toensing.com
* Text Domain: simpletoc
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: TOC, Table of Contents, Gutenberg, block, FAQ
Requires at least: 5.9
Donate link: https://marc.tv/out/donate
Tested up to: 6.4
Stable tag: 6.3.1
Stable tag: 6.3.2
Requires PHP: 7.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -51,6 +51,9 @@ SimpleTOC is open-source and developed on [GitHub Pages](https://github.com/mtoe

== Changelog ==

= 6.3.2 =
* Fixed: Option for automatic refresh did not work in some instances.

= 6.3.0 =
* Added: Option for automatic refresh. This can be disabled in the blocks advanced settings.
* Added: Option to globally disable automatic refresh in the WordPress SimpleTOC settings.
Expand Down
2 changes: 1 addition & 1 deletion src/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/block.json",
"apiVersion": 2,
"name": "simpletoc/toc",
"version": "6.3.0",
"version": "6.3.2",
"title": "SimpleTOC",
"category": "layout",
"icon": "<svg clip-rule='evenodd' fill-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='2' viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'><path d='m365.983 78.248c2.72-32.415 29.921-57.908 63.029-57.908 34.91 0 63.253 28.342 63.253 63.252s-28.343 63.252-63.253 63.252v269.582c0 25.232-20.485 45.718-45.718 45.718h-313.62c-25.233 0-45.719-20.486-45.719-45.718v-292.46c0-25.233 20.486-45.718 45.719-45.718z' fill='#070D0D'/><g fill='#fff'><path d='m423.898 112.744v-24.188h-24.008v-10.108h24.008v-24.008h10.229v24.008h24.008v10.108h-24.008v24.188z'/><path d='m120.04 403.105c-16.883 0-30.511-13.719-30.511-30.714 0-16.79 13.628-30.714 30.511-30.714 16.679 0 30.511 13.924 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714z'/><path d='m170.891 362.153h183.063v20.476h-183.063z'/><path d='m120.04 300.725c-16.883 0-30.511-13.719-30.511-30.714 0-16.79 13.628-30.714 30.511-30.714 16.679 0 30.511 13.924 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714z'/><path d='m170.891 259.773h183.063v20.476h-183.063z'/><path d='m120.04 198.345c-16.883 0-30.511-13.719-30.511-30.714 0-16.791 13.628-30.714 30.511-30.714 16.679 0 30.511 13.923 30.511 30.714 0 16.995-13.832 30.714-30.511 30.714z'/><path d='m170.891 157.393h183.063v20.476h-183.063z'/></g></svg>",
Expand Down
19 changes: 8 additions & 11 deletions src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function Edit( { attributes, setAttributes } ) {
const autoupdateOption = useSelect( ( select ) => {
const optionValue =
select( 'core' ).getSite()?.simpletoc_autoupdate_enabled;
if ( optionValue !== 1 ) {
if ( Number( optionValue ) !== 1 ) {
return true;
}
return false;
Expand Down Expand Up @@ -106,16 +106,13 @@ export default function Edit( { attributes, setAttributes } ) {
setAttributes( { remove_indent: false } );
} }
/>
{ ! attributes.autoupdate ||
( ! autoupdateOption && (
<ToolbarButton
icon={ update }
label={ __( 'Update table of contents', 'simpletoc' ) }
onClick={ () =>
setAttributes( { updated: Date.now() } )
}
/>
) ) }
{ ( ! attributes.autoupdate || ! autoupdateOption ) && (
<ToolbarButton
icon={ update }
label={ __( 'Update table of contents', 'simpletoc' ) }
onClick={ () => setAttributes( { updated: Date.now() } ) }
/>
) }
</BlockControls>
);

Expand Down

0 comments on commit ef84286

Please sign in to comment.