@mtcute/dispatcher 0.26.2 → 0.26.3

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.
Files changed (3) hide show
  1. package/package.json +2 -2
  2. package/wizard.cjs +7 -3
  3. package/wizard.js +7 -3
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mtcute/dispatcher",
3
3
  "type": "module",
4
- "version": "0.26.2",
4
+ "version": "0.26.3",
5
5
  "description": "Updates dispatcher and bot framework for @mtcute/client",
6
6
  "license": "MIT",
7
7
  "scripts": {},
8
8
  "dependencies": {
9
- "@mtcute/core": "^0.26.2",
9
+ "@mtcute/core": "^0.26.3",
10
10
  "@fuman/utils": "0.0.15"
11
11
  },
12
12
  "exports": {
package/wizard.cjs CHANGED
@@ -52,9 +52,13 @@ class WizardScene extends dispatcher.Dispatcher {
52
52
  */
53
53
  // eslint-disable-next-line ts/no-empty-object-type
54
54
  static onNthStep(step) {
55
- const filter = state.state((it) => it.$step === step);
56
- if (step === 0) return logic.or(state.stateEmpty, filter);
57
- return filter;
55
+ if (step === 0) {
56
+ return logic.or(
57
+ state.stateEmpty,
58
+ state.state((it) => it.$step === void 0 || it.$step === 0)
59
+ );
60
+ }
61
+ return state.state((it) => it.$step === step);
58
62
  }
59
63
  /**
60
64
  * Filter that will only pass if the current step is the one after last one added
package/wizard.js CHANGED
@@ -45,9 +45,13 @@ class WizardScene extends Dispatcher {
45
45
  */
46
46
  // eslint-disable-next-line ts/no-empty-object-type
47
47
  static onNthStep(step) {
48
- const filter = state((it) => it.$step === step);
49
- if (step === 0) return or(stateEmpty, filter);
50
- return filter;
48
+ if (step === 0) {
49
+ return or(
50
+ stateEmpty,
51
+ state((it) => it.$step === void 0 || it.$step === 0)
52
+ );
53
+ }
54
+ return state((it) => it.$step === step);
51
55
  }
52
56
  /**
53
57
  * Filter that will only pass if the current step is the one after last one added