File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 189
189
<script >
190
190
import { adm } from ' @/lib/nodes'
191
191
import klyIndexer from ' @/lib/nodes/kly-indexer'
192
- import { AllNodesDisabledError , AllNodesOfflineError } from ' @/lib/nodes/utils/errors'
192
+ import { AllNodesDisabledError , AllNodesOfflineError , NoInternetConnectionError } from ' @/lib/nodes/utils/errors'
193
193
import { PendingTransactionError } from ' @/lib/pending-transactions'
194
194
import axios from ' axios'
195
195
import { nextTick } from ' vue'
@@ -791,6 +791,8 @@ export default {
791
791
message = this .$t (' transfer.error_pending_transaction' , {
792
792
crypto: error .crypto
793
793
})
794
+ } else if (error instanceof NoInternetConnectionError) {
795
+ message = this .$t (' connection.offline' )
794
796
}
795
797
this .$emit (' error' , message)
796
798
})
@@ -801,6 +803,10 @@ export default {
801
803
})
802
804
},
803
805
async sendFunds () {
806
+ if (! navigator .onLine ) {
807
+ throw new NoInternetConnectionError ()
808
+ }
809
+
804
810
if (this .currency === Cryptos .ADM ) {
805
811
let promise
806
812
// 1. if come from Chat then sendMessage
Original file line number Diff line number Diff line change @@ -63,3 +63,9 @@ export class AllNodesDisabledError extends Error {
63
63
export function isAllNodesDisabledError ( error : Error ) : error is AllNodesDisabledError {
64
64
return ( error as AllNodesDisabledError ) . code === CODES . ALL_NODES_DISABLED
65
65
}
66
+
67
+ export class NoInternetConnectionError extends Error {
68
+ constructor ( ) {
69
+ super ( ) ;
70
+ }
71
+ }
You can’t perform that action at this time.
0 commit comments