Skip to content

Commit

Permalink
fix: show error if Profile save failed
Browse files Browse the repository at this point in the history
  • Loading branch information
limpbrains committed Oct 9, 2023
1 parent e00f7b9 commit 05621d6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
"@synonymdev/result": "0.0.2",
"@synonymdev/slashtags-auth": "1.0.0-alpha.6",
"@synonymdev/slashtags-keychain": "1.0.0",
"@synonymdev/slashtags-profile": "1.0.1",
"@synonymdev/slashtags-profile": "1.0.2",
"@synonymdev/slashtags-sdk": "1.0.0-alpha.38",
"@synonymdev/slashtags-url": "1.0.0-alpha.4",
"@synonymdev/slashtags-widget-bitcoin-feed": "1.0.0",
"@synonymdev/slashtags-widget-facts-feed": "1.1.0",
"@synonymdev/slashtags-widget-news-feed": "1.1.0",
"@synonymdev/slashtags-widget-price-feed": "1.1.0",
"@synonymdev/web-relay": "1.0.3",
"@synonymdev/web-relay": "1.0.4",
"assert": "^2.0.0",
"backpack-client": "github:synonymdev/bitkit-backup-client#f08fdb28529d8a3f8bfecc789443c43b966a7581",
"bech32": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/SlashtagsProvider2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Store {
const store = new Store('example1.db') as unknown as Client.Store;

export let webRelayClient: IWebRelayClient;
export let profile: SlashtagsProfile;
let profile: SlashtagsProfile;

export interface ISlashtagsContext2 {
webRelayClient: Client;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/slashtags2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export const saveProfile2 = async (
slashtagsProfile: SlashtagsProfile,
): Promise<Result<string>> => {
try {
await slashtagsProfile.put(profile);
await slashtagsProfile.put(profile, { awaitRelaySync: true });
} catch (e) {
console.log(e.message);
console.log('profile saving error', e);
showToast({
type: 'error',
title: i18n.t('slashtags:error_saving_contact'),
Expand Down
36 changes: 28 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2872,10 +2872,10 @@
b4a "^1.6.4"
sodium-universal "^4.0.0"

"@synonymdev/[email protected].1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@synonymdev/slashtags-profile/-/slashtags-profile-1.0.1.tgz#cf5646554faf5e31ff6d6fa2f46caaca332680bd"
integrity sha512-BgTeKDpuGOoSAmqydkz0dZ6jqdkuU16g4cAsg9gbV56nGWVYdhUVk5K3oaWXlIeLOs78Uu0HUkqvwFHtXQfcdA==
"@synonymdev/[email protected].2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@synonymdev/slashtags-profile/-/slashtags-profile-1.0.2.tgz#0e73bd0d165f1f0f8600a9b337191931d67f5e21"
integrity sha512-vFkYcozOaBjJljBr6D63iTCdJvj9/S2pfcBQN8weLTlW8WEGuiHbxN5aZw50kTeo/NJ1k7AUhEY/ccJTOHE/QQ==
dependencies:
"@synonymdev/slashtags-url" "^1.0.0-alpha.3"
ajv "^8.12.0"
Expand Down Expand Up @@ -2984,17 +2984,18 @@
"@synonymdev/feeds" "^2.0.0"
node-fetch "^2.6.12"

"@synonymdev/[email protected].3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@synonymdev/web-relay/-/web-relay-1.0.3.tgz#e163358092115ff51cd0c33a74830994ee965f4e"
integrity sha512-Gk0CbBOQHcSGYCNvEA4sdqfFgy4LTMAERMVTIoNuxyexcgfmcjwzYvMnOA8e704Bf2FUAylRmcbewmveSAclDg==
"@synonymdev/[email protected].4":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@synonymdev/web-relay/-/web-relay-1.0.4.tgz#68d9254a32f2a462a68e4a3113c2081f39747863"
integrity sha512-Y0RSW/SP8fnUw2az9kWKSKsWiMvbqidTo0Y4zo9GStSnh0C/MQLa4nAq0f0QhCMjGIIGXxePkOGyC9l3iwEJ1A==
dependencies:
"@synonymdev/slashtags-url" "^1.0.0"
b4a "1.6.4"
git-repo-info "^2.1.1"
level "8.0.0"
lmdb "2.8.4"
node-fetch "2.6.12"
prom-client "14.2.0"
sodium-universal "4.0.0"
xmlhttprequest "1.8.0"

Expand Down Expand Up @@ -4146,6 +4147,11 @@ bindings@^1.3.0, bindings@^1.5.0:
dependencies:
file-uri-to-path "1.0.0"

[email protected]:
version "1.0.2"
resolved "https://registry.yarnpkg.com/bintrees/-/bintrees-1.0.2.tgz#49f896d6e858a4a499df85c38fb399b9aff840f8"
integrity sha512-VOMgTMwjAaUG580SXn3LacVgjurrbMme7ZZNYGSSV7mmtY6QQRh0Eg3pwIcntQ77DErK1L0NxkbetjcoXzVwKw==

bip174@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/bip174/-/bip174-2.1.0.tgz#cd3402581feaa5116f0f00a0eaee87a5843a2d30"
Expand Down Expand Up @@ -10492,6 +10498,13 @@ process@^0.11.10:
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==

[email protected]:
version "14.2.0"
resolved "https://registry.yarnpkg.com/prom-client/-/prom-client-14.2.0.tgz#ca94504e64156f6506574c25fb1c34df7812cf11"
integrity sha512-sF308EhTenb/pDRPakm+WgiN+VdM/T1RaHj1x+MvAuT8UiQP8JmOEbxVqtkbfR4LrvOg5n7ic01kRBDGXjYikA==
dependencies:
tdigest "^0.1.1"

promise-polyfill@^6.0.1:
version "6.1.0"
resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-6.1.0.tgz#dfa96943ea9c121fca4de9b5868cb39d3472e057"
Expand Down Expand Up @@ -12586,6 +12599,13 @@ tar@^4.4.8:
safe-buffer "^5.2.1"
yallist "^3.1.1"

tdigest@^0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/tdigest/-/tdigest-0.1.2.tgz#96c64bac4ff10746b910b0e23b515794e12faced"
integrity sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==
dependencies:
bintrees "1.0.2"

[email protected]:
version "1.2.8"
resolved "https://registry.yarnpkg.com/telnet-client/-/telnet-client-1.2.8.tgz#946c0dadc8daa3f19bb40a3e898cb870403a4ca4"
Expand Down

0 comments on commit 05621d6

Please sign in to comment.