@flozy/editor 1.1.8 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -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"