ember-nav-stack 6.0.0 → 6.0.1

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.
@@ -0,0 +1,6 @@
1
+ {
2
+ "eslint.validate": [
3
+ "glimmer-ts",
4
+ "glimmer-js"
5
+ ]
6
+ }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## v6.0.1 (2023-12-15)
2
+
3
+ #### :bug: Bug Fix
4
+ * [#74](https://github.com/yapplabs/ember-nav-stack/pull/74) Add some more checks to make sure element is not destroyed before accessing it ([@lukemelia](https://github.com/lukemelia))
5
+ * [#73](https://github.com/yapplabs/ember-nav-stack/pull/73) Avoid trying to access this.element when component has been torn down ([@lukemelia](https://github.com/lukemelia))
6
+
7
+ #### Committers: 1
8
+ - Luke Melia ([@lukemelia](https://github.com/lukemelia))
9
+
1
10
  ## v6.0.0 (2023-12-03)
2
11
 
3
12
  #### :boom: Breaking Change
@@ -157,10 +157,12 @@ export default class NavStack extends Component {
157
157
  @action
158
158
  tearDownHammer() {
159
159
  let { hammer, gesture } = this;
160
- gesture.unregister(this, hammer.get('pan'));
161
- hammer.off('pan');
162
- hammer.destroy();
163
- this.hammer = null;
160
+ if (hammer) {
161
+ gesture.unregister(this, hammer.get('pan'));
162
+ hammer.off('pan');
163
+ hammer.destroy();
164
+ this.hammer = null;
165
+ }
164
166
  }
165
167
 
166
168
  @action
@@ -169,6 +171,10 @@ export default class NavStack extends Component {
169
171
  }
170
172
 
171
173
  handleStackDepthChange(isInitialRender) {
174
+ if (this.isDestroying || this.isDestroyed) {
175
+ return;
176
+ }
177
+
172
178
  let stackItems = this.stackItems || [];
173
179
  let stackDepth = stackItems.length;
174
180
  let rootComponentRef = stackItems[0] && stackItems[0].component;
@@ -234,6 +240,10 @@ export default class NavStack extends Component {
234
240
  }
235
241
 
236
242
  cut() {
243
+ if (this.isDestroying || this.isDestroyed) {
244
+ return;
245
+ }
246
+
237
247
  this.horizontalTransition({
238
248
  toValue: this.computeXPosition(),
239
249
  animate: false,
@@ -249,6 +259,9 @@ export default class NavStack extends Component {
249
259
  }
250
260
 
251
261
  slideForward() {
262
+ if (this.isDestroying || this.isDestroyed) {
263
+ return;
264
+ }
252
265
  this.horizontalTransition({
253
266
  toValue: this.computeXPosition(),
254
267
  finishCallback: () => {
@@ -258,6 +271,9 @@ export default class NavStack extends Component {
258
271
  }
259
272
 
260
273
  slideBack() {
274
+ if (this.isDestroying || this.isDestroyed) {
275
+ return;
276
+ }
261
277
  this.horizontalTransition({
262
278
  toValue: this.computeXPosition(),
263
279
  finishCallback: () => {
@@ -268,6 +284,10 @@ export default class NavStack extends Component {
268
284
  }
269
285
 
270
286
  slideUp() {
287
+ if (this.isDestroying || this.isDestroyed) {
288
+ return;
289
+ }
290
+
271
291
  let debug = this.birdsEyeDebugging;
272
292
  this.verticalTransition({
273
293
  element: this.element,
@@ -277,6 +297,9 @@ export default class NavStack extends Component {
277
297
  }
278
298
 
279
299
  slideDown() {
300
+ if (this.isDestroying || this.isDestroyed) {
301
+ return;
302
+ }
280
303
  let debug = this.birdsEyeDebugging;
281
304
  let clonedElement = this.clones.elements[this.clones.elements.length - 1];
282
305
  let y = debug ? 480 : clonedElement.getBoundingClientRect().height;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-nav-stack",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "The default blueprint for ember-cli addons.",
5
5
  "keywords": [
6
6
  "ember-addon"