@flozy/editor 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -102,9 +102,10 @@ const CommonEditor = props => {
102
102
  };
103
103
  const updateChanges = newValue => {
104
104
  const stringify = JSON.stringify(newValue);
105
- if (stringify !== lastUpdated) {
105
+ const text = serialize(newValue);
106
+ if (stringify !== lastUpdated && count > 0 && text?.trim().length > 3) {
106
107
  onSave(stringify, {
107
- text: serialize(newValue)
108
+ text: text
108
109
  });
109
110
  setLastUpdated(stringify);
110
111
  }
@@ -4,7 +4,7 @@ const useTimeout = props => {
4
4
  const {
5
5
  timeoutInMS
6
6
  } = props;
7
- const [count, setCount] = useState(0);
7
+ const [count, setCount] = useState(-1);
8
8
  const onReset = () => {
9
9
  clearTimeout(t);
10
10
  t = setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"