Skip to content

Commit 16b0a3c

Browse files
authored
Merge pull request #14 from brocoders/sbChannelListConfiguration
allow to fetch empty channels
2 parents 67db2e6 + 26a1cfc commit 16b0a3c

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

lib/constants.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/**
3-
* sendbird-helpers v0.1.34
4-
* SendBird helpers
3+
* sendbird-utils v0.0.3
4+
* SendBird utils
55
*/
66

77
'use strict';

lib/imAdapters.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/**
3-
* sendbird-helpers v0.1.34
4-
* SendBird helpers
3+
* sendbird-utils v0.0.3
4+
* SendBird utils
55
*/
66

77
'use strict';

lib/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/**
3-
* sendbird-helpers v0.1.34
4-
* SendBird helpers
3+
* sendbird-utils v0.0.3
4+
* SendBird utils
55
*/
66

77
'use strict';
@@ -360,7 +360,9 @@ function fetchChannel(channelListQuery, resolve, reject) {
360360

361361
function sbChannelList() {
362362
var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 5;
363+
var includeEmpty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
363364
var channelListQuery = sbCreateGroupChannelListQuery();
365+
channelListQuery.includeEmpty = includeEmpty;
364366
channelListQuery.limit = limit;
365367
return new Promise(function (resolve, reject) {
366368
fetchChannel(channelListQuery, resolve, reject);

lib/jsAdapters.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/**
3-
* sendbird-helpers v0.1.34
4-
* SendBird helpers
3+
* sendbird-utils v0.0.3
4+
* SendBird utils
55
*/
66

77
'use strict';

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sendbird-utils",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "SendBird utils",
55
"main": "lib/index.js",
66
"repository": "https://github.com/brocoders/sendbird-utils.git",

src/groupChannel.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ function fetchChannel(
5050
});
5151
}
5252

53-
export function sbChannelList(limit: number = 5): Promise<$ReadOnlyArray<GroupChannel>> {
53+
export function sbChannelList(limit: number = 5, includeEmpty: boolean = false): Promise<$ReadOnlyArray<GroupChannel>> {
5454
const channelListQuery = sbCreateGroupChannelListQuery();
55+
channelListQuery.includeEmpty = includeEmpty;
5556
channelListQuery.limit = limit;
5657
return new Promise((resolve, reject) => {
5758
fetchChannel(channelListQuery, resolve, reject);

0 commit comments

Comments
 (0)