Skip to content

Commit 8623721

Browse files
author
queue-it
committed
Preparing release 1.1.6
1 parent e2b2956 commit 8623721

File tree

9 files changed

+32
-26
lines changed

9 files changed

+32
-26
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ dependencies {
130130
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
131131

132132
//App dependencies
133-
implementation 'com.queue-it.androidsdk:library:2.0.35'
133+
implementation 'com.queue-it.androidsdk:library:2.0.36'
134134
implementation 'com.android.support:appcompat-v7:28.0.0'
135135
implementation 'com.android.support:design:28.0.0'
136136
}

android/src/main/java/com/reactnativequeueit/QueueItModule.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ class QueueItModule(reactContext: ReactApplicationContext)
5757
sendEvent(context, "openingQueueView", params)
5858
}
5959

60-
override fun onQueueDisabled() {
60+
override fun onQueueDisabled(queueDisabledInfo: QueueDisabledInfo?) {
6161
handler.post {
6262
val params = Arguments.createMap()
63-
params.putNull("queueittoken")
63+
val token = if (queueDisabledInfo?.queueItToken != null) queueDisabledInfo.queueItToken else ""
64+
params.putString("queueittoken", token)
6465
params.putString("state", EnqueueResultState.Disabled.name)
6566
promise.resolve(params)
6667
}

example/src/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ class App extends Component<{}, AppState> {
7373
}
7474
switch (enqueueResult.State) {
7575
case EnqueueResultState.Disabled:
76-
console.log('queue is disabled');
76+
console.log(
77+
`queue is disabled and token is: ${enqueueResult.QueueITToken}`
78+
);
7779
break;
7880
case EnqueueResultState.Passed:
7981
console.log(`

ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ target 'QueueIt' do
88
# Pods for QueueIt
99

1010
# Our pods
11-
pod 'QueueITLibrary', '~>3.0.8'
11+
pod 'QueueITLibrary', '~>3.0.10'
1212
end

ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
PODS:
2-
- QueueITLibrary (3.0.8)
2+
- QueueITLibrary (3.0.10)
33

44
DEPENDENCIES:
5-
- QueueITLibrary (~> 3.0.8)
5+
- QueueITLibrary (~> 3.0.10)
66

77
SPEC REPOS:
88
trunk:
99
- QueueITLibrary
1010

1111
SPEC CHECKSUMS:
12-
QueueITLibrary: 0ed653c2f57929946b85269b0f53493fe316ad70
12+
QueueITLibrary: 92c209cefa54de9e13938905e7a3fdcef9093b28
1313

14-
PODFILE CHECKSUM: f1464695591b30db9d8abb2f3c3ebbc9ee974d04
14+
PODFILE CHECKSUM: f9c6ce5437b6535acb08486bebb74f815b4f0f7e
1515

1616
COCOAPODS: 1.11.2

ios/QueueIt.mm

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ -(void) handleRunResult:(BOOL)success
8383
language: (NSString*) language
8484
withResolver:(RCTPromiseResolveBlock)resolve
8585
withRejecter:(RCTPromiseRejectBlock)reject){
86-
86+
8787
UIViewController* vc = RCTPresentedViewController();
8888
[self initializeEngine:vc customerId:customerId eventOrAliasId:eventOrAliasId layoutName:layoutName language:language];
8989
self.resolve = resolve;
9090
self.reject = reject;
91-
91+
9292
NSError* error = nil;
9393
@try {
9494
BOOL success = [self.engine run:&error];
@@ -106,12 +106,12 @@ -(void) handleRunResult:(BOOL)success
106106
language: (NSString*) language
107107
withResolver:(RCTPromiseResolveBlock)resolve
108108
withRejecter:(RCTPromiseRejectBlock)reject){
109-
109+
110110
UIViewController* vc = RCTPresentedViewController();
111111
[self initializeEngine:vc customerId:customerId eventOrAliasId:eventOrAliasId layoutName:layoutName language:language];
112112
self.resolve = resolve;
113113
self.reject = reject;
114-
114+
115115
NSError* error = nil;
116116
@try {
117117
BOOL success = [self.engine runWithEnqueueToken:enqueueToken error:&error];
@@ -129,12 +129,12 @@ -(void) handleRunResult:(BOOL)success
129129
language: (NSString*) language
130130
withResolver:(RCTPromiseResolveBlock)resolve
131131
withRejecter:(RCTPromiseRejectBlock)reject){
132-
132+
133133
UIViewController* vc = RCTPresentedViewController();
134134
[self initializeEngine:vc customerId:customerId eventOrAliasId:eventOrAliasId layoutName:layoutName language:language];
135135
self.resolve = resolve;
136136
self.reject = reject;
137-
137+
138138
NSError* error = nil;
139139
@try {
140140
BOOL success = [self.engine runWithEnqueueKey:enqueueKey error:&error];
@@ -161,8 +161,12 @@ - (void)notifyQueueViewWillOpen {
161161
[self sendEventWithName:@"openingQueueView" body:@{}];
162162
}
163163

164-
- (void)notifyQueueDisabled {
165-
self.resolve(@{@"queueittoken": @"", @"state": ENQUEUE_STATE(Disabled)});
164+
- (void)notifyQueueDisabled:(QueueDisabledInfo *)queueDisabledInfo {
165+
NSString *queueItToken = queueDisabledInfo.queueitToken;
166+
if(queueItToken==nil){
167+
queueItToken = @"";
168+
}
169+
self.resolve(@{@"queueittoken": queueItToken, @"state": ENQUEUE_STATE(Disabled)});
166170
}
167171

168172
- (void)notifyQueueITUnavailable:(NSString *)errorMessage {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-queue-it",
3-
"version": "1.1.5",
3+
"version": "1.1.6",
44
"description": "React Native Module for integrating Queue-it's virtual waiting room into React Native apps.",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",
@@ -105,7 +105,8 @@
105105
"plugin:jest/recommended"
106106
],
107107
"rules": {
108-
"comma-dangle": "off"
108+
"comma-dangle": "off",
109+
"no-unused-vars": "warn"
109110
},
110111
"env": {
111112
"jest/globals": true

src/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/* exported EnqueueResultState.Passed */
1+
/* exported EnqueueResultState */
22
import {
33
NativeModules,
4-
NativeModule,
54
EventSubscriptionVendor,
65
NativeEventEmitter,
76
EmitterSubscription,
@@ -33,10 +32,9 @@ interface NativeQueueItModule {
3332
): Promise<any>;
3433
}
3534

36-
const nativeQueueIt: EventSubscriptionVendor &
37-
NativeModule &
38-
NativeQueueItModule = NativeModules.QueueIt;
39-
const queueItEventEmitter = new NativeEventEmitter(nativeQueueIt);
35+
const nativeQueueIt: EventSubscriptionVendor & NativeQueueItModule =
36+
NativeModules.QueueIt;
37+
const queueItEventEmitter = new NativeEventEmitter(nativeQueueIt as any);
4038

4139
export enum EnqueueResultState {
4240
Passed = 'Passed',

0 commit comments

Comments
 (0)