Skip to content

Commit a96a598

Browse files
committed
update
1 parent 1c842bf commit a96a598

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

dsbridge/DWKWebView.m

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -298,18 +298,18 @@ -(NSString *)call:(NSString*) method :(NSString*) argStr
298298
__strong typeof(self) strongSelf = weakSelf;
299299
@synchronized(self)
300300
{
301-
// UInt64 t=[[NSDate date] timeIntervalSince1970]*1000;
302-
// jsCache=[jsCache stringByAppendingString:js];
303-
// if(t-lastCallTime<50){
304-
// if(!isPending){
305-
// [strongSelf evalJavascript:50];
306-
// isPending=true;
307-
// }
308-
// }else{
309-
// [strongSelf evalJavascript:0];
310-
// }
311-
[strongSelf evaluateJavaScript:js completionHandler:nil];
312-
NSLog(@"evaluateJavaScript:%@, %@",[JSBUtil objToJsonString:result], complete ? @"true" : @"false");
301+
UInt64 t=[[NSDate date] timeIntervalSince1970]*1000;
302+
jsCache=[jsCache stringByAppendingString:js];
303+
if(t-lastCallTime<1000){
304+
if(!isPending){
305+
[strongSelf evalJavascript:1000];
306+
isPending=true;
307+
}
308+
}else{
309+
[strongSelf evalJavascript:0];
310+
}
311+
// [strongSelf evaluateJavaScript:js completionHandler:nil];
312+
// NSLog(@"evaluateJavaScript:%@, %@",[JSBUtil objToJsonString:result], complete ? @"true" : @"false");
313313
}
314314
});
315315

0 commit comments

Comments
 (0)