-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛(llm): avoid blink on unsynch LLM (#7836)
- Loading branch information
1 parent
332312b
commit d9a4644
Showing
13 changed files
with
196 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"live-mobile": patch | ||
--- | ||
|
||
Avoid blink when LLM is unsync |
8 changes: 8 additions & 0 deletions
8
apps/ledger-live-mobile/__mocks__/api/LedgerSync/authenticate.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJ0cnVzdGNoYWluLWJhY2tlbmQuYXBpLmF3cy5zdGcubGRnLXRlY2guY29tIiwic3ViIjoiMDMyNjk2ZWJkN2MyNzZjYjIwODM4MmNjYTk2Mzg4YWJjNWYxNTBkNDE1YjU5OWY3OTgzZmYzNTc1YmNlNDQxNDAxIiwiYXVkIjpbIkNsb3VkU3luYyIsInRydXN0Y2hhaW4iXSwiZXhwIjoxNzI2NjY1MjUwLCJpYXQiOjE3MjY2NjQ5NDksImp0aSI6IjhkM2JiYTVmLTg1NGYtNDkyNy1iZDFjLWUwMzE1NjE4Y2VmMCIsInBlcm1pc3Npb25zIjp7fSwiZGV2aWNlIjp0cnVlLCJyZWZyZXNoRXhwaXJhdGlvbiI6IjIwMjQtMDktMThUMTQ6MDk6MTBaIn0.wUyEXD488WSbKbdOM7Wk33SjKMzm7VGP3nCGRfTYhgNkI6vNdPrEQnrwKo6uloWsVvL5BrNpBCkd_8GPf2eyZw", | ||
"permissions": { | ||
"000c9ec1a1ab774f7eaeff2b0d4ad695f1fa07ea28d33f5d34126cb1152d6d83f6": { | ||
"m/0'/16'/0'": ["owner"] | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
apps/ledger-live-mobile/__mocks__/api/LedgerSync/challenge.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"json": { | ||
"version": 0, | ||
"challenge": { | ||
"data": "f0c8ba737d490e16fb10dec07d2ae872", | ||
"expiry": "2024-09-18T13:41:45Z" | ||
}, | ||
"host": "trustchain-backend.api.aws.stg.ldg-tech.com", | ||
"rp": [ | ||
{ | ||
"credential": { | ||
"version": 0, | ||
"curveId": 33, | ||
"signAlgorithm": 1, | ||
"publicKey": "03cb7628e7248ddf9c07da54b979f16bf081fb3d173aac0992ad2a44ef6a388ae2" | ||
}, | ||
"signature": "3045022100fc6b314d0cfc74ccb3b3aa2ff0d5648c9b4e8ef997eae2370593f78223be0b1b02201e56255b3b3caf29a349ca8d69c0955b32f0eed54d70077d2b46f23b4fb19052" | ||
} | ||
], | ||
"protocolVersion": { | ||
"major": 1, | ||
"minor": 0, | ||
"patch": 0 | ||
} | ||
}, | ||
"tlv": "0101070201001210f0c8ba737d490e16fb10dec07d2ae87214010115473045022100fc6b314d0cfc74ccb3b3aa2ff0d5648c9b4e8ef997eae2370593f78223be0b1b02201e56255b3b3caf29a349ca8d69c0955b32f0eed54d70077d2b46f23b4fb19052160466ead899202b7472757374636861696e2d6261636b656e642e6170692e6177732e7374672e6c64672d746563682e636f6d320121332103cb7628e7248ddf9c07da54b979f16bf081fb3d173aac0992ad2a44ef6a388ae2600401000000" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "name": "cloud-sync-backend-service", "version": "0.5.1-RC2" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"m/": "01010102201415fb105d3e3cf464bcb7cce33380c480941659f7898948d35a5baf6c29b2930621032696ebd7c276cb208382cca96388abc5f150d415b599f7983ff3575bce44140101010110b005000102000006210306e3967662753cee32f227206f75327f0cc8fe0ca946ffd3f506fc4177b67fbe05100991dfda0c5bccdef61c983b284d4d0105508e4a84ab9ddedca1e31f3a7ee15f01666dd6e25f029527bc7901956aea2938a187cdfcf105932be5f8839d4722fd7e5bcde14afdd48622c9ce1d7049d48f8d6e23e352d05ace6494ec5e4090b0680807062102a9ae8ecdae5e00ff5a5f825c69d2994ce6f8833137f5df30eb8022db4f0ac2170346304402206c05e3366d190556062cc64a5cdcd294aa79e81259a1d82676d94dfe402243b4022043c6fede859beb41e0847905869b9ac4bc4050f25f507cf6324da360f24eb682", | ||
"m/16'": "01010102200c9ec1a1ab774f7eaeff2b0d4ad695f1fa07ea28d33f5d34126cb1152d6d83f60621032696ebd7c276cb208382cca96388abc5f150d415b599f7983ff3575bce44140101010315b8050c800000008000001080000000062103183c0c8122c89dd59204919d434f08abf831e743fd826e4ce9bbdb9cad49d6710510b27a7045d2537beb7093c0f96459d9150550b356f67f576caaf6c57bec42cfff397a3ab970844fa380f0b186129155dd3973fa3ab445201dc7e0a5537e7ae3b175594dc6db58b34ef9b5162cfbdd78b4d72ea46189532bc4889ef46a35131467c5b8062103f1041567f9b8b0f658388e2d7f033239e2884c109fa4c1a751e7ae2e3d640e181137040c64656275672d643638326230062103d682b0be923a68e2aa077c3b49c79be57d447d8dca615628f5adceb2ccd175be0104ffffffff12aa0510b5fb0ca72e5c79d5b2229eba894ee85d05505807e4e403453725031e892885aba11acec0ea1f814b013a0e4841e24ab07cd4c1c9dc9c2829c992d3a0ae416a7db24e9b96cc73c2454c8b5849aaa3db2c80afa395bab59957e6b17d7fdbd5ec124476062103d682b0be923a68e2aa077c3b49c79be57d447d8dca615628f5adceb2ccd175be0621020918680272a96341dadeb69e43800618c739f150c066162065ff351d4298de3a0346304402202ffa1cb831595fe2594fd45c094987b32b49934bef9f285ff6086997a3ab46b3022043ba33239b19a0323788d29c2c638d4408097f144194219cc813ae4e31a476d6" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import marketHandlers from "./market"; | ||
import ledgerSyncHandlers from "./ledgerSync"; | ||
|
||
export const ALLOWED_UNHANDLED_REQUESTS = [ | ||
"ledger.statuspage.io", | ||
"cdn.live.ledger.com/announcements", | ||
"swap.ledger.com/v5/currencies/all", | ||
"https://cdn.live.ledger.com/swap-providers/data.json", | ||
"https://crypto-assets-service.api.ledger.com/v1/partners?output=name,signature,public_key,public_key_curve&service_name=swap", | ||
]; | ||
|
||
export default [...marketHandlers]; | ||
export default [...marketHandlers, ...ledgerSyncHandlers]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { http, HttpResponse } from "msw"; | ||
import AuthenticateJson from "../../__mocks__/api/LedgerSync/authenticate.json"; | ||
import ChallengeJson from "../../__mocks__/api/LedgerSync/challenge.json"; | ||
import InfoJson from "../../__mocks__/api/LedgerSync/info.json"; | ||
import v1Json from "../../__mocks__/api/LedgerSync/v1.json"; | ||
const handlers = [ | ||
http.post("https://trustchain-backend.api.aws.stg.ldg-tech.com/v1/authenticate", () => { | ||
return HttpResponse.json(AuthenticateJson); | ||
}), | ||
http.get("https://trustchain-backend.api.aws.stg.ldg-tech.com/v1/challenge", () => { | ||
return HttpResponse.json(ChallengeJson); | ||
}), | ||
http.get("https://cloud-sync-backend.api.aws.stg.ldg-tech.com/_info", () => { | ||
return HttpResponse.json(InfoJson); | ||
}), | ||
http.get("https://trustchain-backend.api.aws.stg.ldg-tech.com/_info", () => { | ||
return HttpResponse.json(InfoJson); | ||
}), | ||
http.get( | ||
"https://trustchain-backend.api.aws.stg.ldg-tech.com/v1/trustchain/000c9ec1a1ab774f7eaeff2b0d4ad695f1fa07ea28d33f5d34126cb1152d6d83f6", | ||
() => { | ||
return HttpResponse.json(v1Json); | ||
}, | ||
), | ||
]; | ||
|
||
export default handlers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
apps/ledger-live-mobile/src/newArch/features/WalletSync/hooks/useCustomTimeOut.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useEffect, useState } from "react"; | ||
|
||
export function useCustomTimeOut(timeout: number) { | ||
const [isTimeout, setIsTimeout] = useState(false); | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
setIsTimeout(true); | ||
}, timeout); | ||
|
||
return () => { | ||
clearTimeout(timer); | ||
}; | ||
}, [timeout]); | ||
|
||
return isTimeout; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters