Skip to content

Commit 4178cb7

Browse files
committed
Added a flag indicating the completion of initialization.(#18)
1 parent a531eaa commit 4178cb7

8 files changed

Lines changed: 18 additions & 9 deletions

File tree

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Add the following code to the `build.gradle.kts` file in the `app` module:
1818
dependencies {
1919
// The extension package must be used with the main framework "dora"
2020
implementation("com.github.dora4:dora:1.3.43")
21-
implementation("com.github.dora4:dora-walletconnect-support:2.1.33")
21+
implementation("com.github.dora4:dora-walletconnect-support:2.1.34")
2222
}
2323
```
2424

docs/es/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Añade el siguiente código en el archivo `build.gradle.kts` del módulo `app`:
1818
dependencies {
1919
// El paquete de extensión debe usarse con el framework principal "dora"
2020
implementation("com.github.dora4:dora:1.3.43")
21-
implementation("com.github.dora4:dora-walletconnect-support:2.1.33")
21+
implementation("com.github.dora4:dora-walletconnect-support:2.1.34")
2222
}
2323
```
2424

docs/fr/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Ajoutez le code suivant dans le fichier `build.gradle.kts` du module `app` :
1818
dependencies {
1919
// Le package d'extension doit être utilisé avec le framework principal "dora"
2020
implementation("com.github.dora4:dora:1.3.43")
21-
implementation("com.github.dora4:dora-walletconnect-support:2.1.33")
21+
implementation("com.github.dora4:dora-walletconnect-support:2.1.34")
2222
}
2323
```
2424

docs/ko/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencyResolutionManagement {
1818
dependencies {
1919
// 확장 패키지는 메인 프레임워크 "dora"와 함께 사용해야 합니다.
2020
implementation("com.github.dora4:dora:1.3.43")
21-
implementation("com.github.dora4:dora-walletconnect-support:2.1.33")
21+
implementation("com.github.dora4:dora-walletconnect-support:2.1.34")
2222
}
2323
```
2424

docs/zh-cn/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencyResolutionManagement {
1818
dependencies {
1919
// 扩展包必须在有主框架dora的情况下使用
2020
implementation("com.github.dora4:dora:1.3.43")
21-
implementation("com.github.dora4:dora-walletconnect-support:2.1.33")
21+
implementation("com.github.dora4:dora-walletconnect-support:2.1.34")
2222
}
2323
```
2424

docs/zh-tw/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencyResolutionManagement {
1818
dependencies {
1919
// 擴展包必須與主框架 "dora" 一起使用
2020
implementation("com.github.dora4:dora:1.3.43")
21-
implementation("com.github.dora4:dora-walletconnect-support:2.1.33")
21+
implementation("com.github.dora4:dora-walletconnect-support:2.1.34")
2222
}
2323
```
2424

lib/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ afterEvaluate {
7575
from(components["release"])
7676
groupId = "com.github.dora4"
7777
artifactId = "dora-walletconnect-support"
78-
version = "2.1.33"
78+
version = "2.1.34"
7979
}
8080
}
8181
}

lib/src/main/java/dora/pay/DoraFund.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ object DoraFund {
284284
* @since 2.0
285285
*/
286286
fun isWalletConnected(): Boolean {
287-
return Web3Modal.getAccount() != null
287+
return initialized && Web3Modal.getAccount() != null
288288
}
289289

290290
/**
@@ -317,6 +317,9 @@ object DoraFund {
317317
* @since 2.0
318318
*/
319319
fun connectWallet(context: Context) {
320+
if (!initialized) {
321+
return
322+
}
320323
IntentUtils.startActivity(context, WalletConnectActivity::class.java)
321324
}
322325

@@ -330,6 +333,9 @@ object DoraFund {
330333
* @since 2.0
331334
*/
332335
fun connectWallet(activity: Activity, requestCode: Int) {
336+
if (!initialized) {
337+
return
338+
}
333339
IntentUtils.startActivityForResult(activity, WalletConnectActivity::class.java, requestCode)
334340
}
335341

@@ -374,6 +380,9 @@ object DoraFund {
374380
* @since 2.1
375381
*/
376382
fun connectWallet(requestCode: Int) {
383+
if (!initialized) {
384+
return
385+
}
377386
connectWalletLaunchers[requestCode]?.launch(Unit)
378387
}
379388

@@ -390,7 +399,7 @@ object DoraFund {
390399
* @since 2.0
391400
*/
392401
fun disconnectWallet(onSuccess: () -> Unit, onError: (Throwable) -> Unit) {
393-
if (Web3Modal.getAccount() != null) {
402+
if (initialized && Web3Modal.getAccount() != null) {
394403
Web3Modal.disconnect(onSuccess, onError)
395404
}
396405
}

0 commit comments

Comments
 (0)