diff --git a/arkoala-arkts/application/package.json b/arkoala-arkts/application/package.json index 7de414ab680a0caea0d8c6b7fd29456a0aa391ea..72ae0af9691e25df5f1070e9690009d06dcbb3a4 100644 --- a/arkoala-arkts/application/package.json +++ b/arkoala-arkts/application/package.json @@ -3,7 +3,7 @@ "version": "1.4.1", "description": "", "scripts": { - "clean": "rimraf shopping/entry/build shopping/generated shopping/oh_modules", + "clean": "rimraf shopping/entry/build shopping/generated shopping/oh_modules shopping/.hvigor", "arkoala:har:arm32": "npm run arkoala:har-arm32 --prefix ../../arkoala-arkts", "arkoala:har:arm64": "npm run arkoala:har-arm64 --prefix ../../arkoala-arkts", diff --git a/incremental/runtime/src/states/State.ts b/incremental/runtime/src/states/State.ts index b3469f72aa33fa24d5d77c936fe0bc806e59e8d2..8112d182df81ff6cf6ae99cd4b27f4b898869296 100644 --- a/incremental/runtime/src/states/State.ts +++ b/incremental/runtime/src/states/State.ts @@ -502,8 +502,8 @@ class StateManagerImpl implements StateManager { } mutableState(initial: Value, global?: boolean, equivalent?: Equivalent, tracker?: ValueTracker): MutableState { - if (global != true && (this.current == undefined ? false : !(this.current!.once))) throw new Error("unnamed local state created in memo-context without remember") - if (global === undefined) global = this.current == undefined || !(this.current!.once) + if (global != true && this.current?.once == false) throw new Error("unnamed local state created in memo-context without remember") + if (global === undefined) global = this.current?.once != true else if (!global && !this.current) throw new Error("unnamed local state created in global context") return new StateImpl(this, initial, global, equivalent, tracker) }