Skip to content

Commit 8dd68c0

Browse files
committed
package updates and cleanup
1 parent 8c8cb2f commit 8dd68c0

File tree

5 files changed

+668
-1233
lines changed

5 files changed

+668
-1233
lines changed

addon/components/cloudinary-resource-list.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import Component from '@glimmer/component';
22
import { getOwner } from '@ember/application';
3-
import fetch from 'fetch';
43
import { debug } from '@ember/debug';
54
import { tracked } from '@glimmer/tracking';
65

76
export default class CloudinaryResourceList extends Component {
8-
@tracked _items;
7+
@tracked _items = [];
98

109
constructor(owner, args) {
1110
super(owner, args);
@@ -39,9 +38,14 @@ export default class CloudinaryResourceList extends Component {
3938
}
4039

4140
handleCloudinaryResponse(response) {
41+
if (!response || !response.resources) {
42+
debug('Invalid response from Cloudinary');
43+
return;
44+
}
45+
4246
response.resources.sort((a, b) => {
4347
if (!a.context || !a.context.custom || !b.context || !b.context.custom) {
44-
return;
48+
return 0;
4549
}
4650

4751
let {

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
22

33
module.exports = {
4-
name: require('./package').name,
4+
name: require('./package').name
55
};

0 commit comments

Comments
 (0)