Skip to content

Commit 1683841

Browse files
authored
Merge pull request #187 from JongtaekChoi/fix/setup-once
[Feat] Add setup completion tracking to prevent multiple setup calls
2 parents 335ce6d + ba995ac commit 1683841

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ios/LineLoginModule.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Foundation
22
import LineSDK
33

44
@objc(LineLogin) public class LineLogin: NSObject {
5+
56
@objc public static func application(
67
_ application: UIApplication,
78
open url: URL,
@@ -20,7 +21,12 @@ import LineSDK
2021

2122
@objc func setup(_ arguments: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock,
2223
rejecter reject: @escaping RCTPromiseRejectBlock) {
23-
24+
25+
if LoginManager.shared.isSetupFinished {
26+
reject("SETUP_ALREADY_COMPLETED", "Setup has already been completed", nil)
27+
return
28+
}
29+
2430
guard let channelID = arguments["channelId"] as? String else {
2531
reject("INVALID_ARGUMENTS", "Missing required argument: channelId", nil)
2632
return

0 commit comments

Comments
 (0)