mirror of
https://github.com/luminous-devs/lume.git
synced 2024-09-18 11:13:30 +00:00
fix logout function, prepare for multi-account support
This commit is contained in:
parent
472925bb05
commit
a1fa777f8c
@ -20,7 +20,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ctrl/magnet-link": "^3.1.2",
|
"@ctrl/magnet-link": "^3.1.2",
|
||||||
"@getalby/sdk": "^2.4.0",
|
"@getalby/sdk": "^2.4.0",
|
||||||
"@nostr-dev-kit/ndk": "^0.8.23",
|
"@nostr-dev-kit/ndk": "^1.0.0",
|
||||||
"@nostr-fetch/adapter-ndk": "^0.12.2",
|
"@nostr-fetch/adapter-ndk": "^0.12.2",
|
||||||
"@radix-ui/react-alert-dialog": "^1.0.4",
|
"@radix-ui/react-alert-dialog": "^1.0.4",
|
||||||
"@radix-ui/react-collapsible": "^1.0.3",
|
"@radix-ui/react-collapsible": "^1.0.3",
|
||||||
@ -28,7 +28,7 @@
|
|||||||
"@radix-ui/react-dropdown-menu": "^2.0.5",
|
"@radix-ui/react-dropdown-menu": "^2.0.5",
|
||||||
"@radix-ui/react-popover": "^1.0.6",
|
"@radix-ui/react-popover": "^1.0.6",
|
||||||
"@radix-ui/react-tooltip": "^1.0.6",
|
"@radix-ui/react-tooltip": "^1.0.6",
|
||||||
"@tanstack/react-query": "^4.33.0",
|
"@tanstack/react-query": "^4.35.0",
|
||||||
"@tanstack/react-virtual": "3.0.0-beta.54",
|
"@tanstack/react-virtual": "3.0.0-beta.54",
|
||||||
"@tauri-apps/api": "^1.4.0",
|
"@tauri-apps/api": "^1.4.0",
|
||||||
"@tiptap/extension-image": "^2.1.8",
|
"@tiptap/extension-image": "^2.1.8",
|
||||||
|
@ -8,11 +8,11 @@ dependencies:
|
|||||||
specifier: ^2.4.0
|
specifier: ^2.4.0
|
||||||
version: 2.4.0
|
version: 2.4.0
|
||||||
'@nostr-dev-kit/ndk':
|
'@nostr-dev-kit/ndk':
|
||||||
specifier: ^0.8.23
|
specifier: ^1.0.0
|
||||||
version: 0.8.23(typescript@5.2.2)
|
version: 1.0.0(typescript@5.2.2)
|
||||||
'@nostr-fetch/adapter-ndk':
|
'@nostr-fetch/adapter-ndk':
|
||||||
specifier: ^0.12.2
|
specifier: ^0.12.2
|
||||||
version: 0.12.2(@nostr-dev-kit/ndk@0.8.23)(nostr-fetch@0.13.0)
|
version: 0.12.2(@nostr-dev-kit/ndk@1.0.0)(nostr-fetch@0.13.0)
|
||||||
'@radix-ui/react-alert-dialog':
|
'@radix-ui/react-alert-dialog':
|
||||||
specifier: ^1.0.4
|
specifier: ^1.0.4
|
||||||
version: 1.0.4(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)
|
version: 1.0.4(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)
|
||||||
@ -32,8 +32,8 @@ dependencies:
|
|||||||
specifier: ^1.0.6
|
specifier: ^1.0.6
|
||||||
version: 1.0.6(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)
|
version: 1.0.6(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)
|
||||||
'@tanstack/react-query':
|
'@tanstack/react-query':
|
||||||
specifier: ^4.33.0
|
specifier: ^4.35.0
|
||||||
version: 4.33.0(react-dom@18.2.0)(react@18.2.0)
|
version: 4.35.0(react-dom@18.2.0)(react@18.2.0)
|
||||||
'@tanstack/react-virtual':
|
'@tanstack/react-virtual':
|
||||||
specifier: 3.0.0-beta.54
|
specifier: 3.0.0-beta.54
|
||||||
version: 3.0.0-beta.54(react@18.2.0)
|
version: 3.0.0-beta.54(react@18.2.0)
|
||||||
@ -950,8 +950,8 @@ packages:
|
|||||||
'@nodelib/fs.scandir': 2.1.5
|
'@nodelib/fs.scandir': 2.1.5
|
||||||
fastq: 1.15.0
|
fastq: 1.15.0
|
||||||
|
|
||||||
/@nostr-dev-kit/ndk@0.8.23(typescript@5.2.2):
|
/@nostr-dev-kit/ndk@1.0.0(typescript@5.2.2):
|
||||||
resolution: {integrity: sha512-wX/9Cl02gCR0Kz25C/1xxGO47K13Ve1x8IISbkF/M3RTTXftYBvzB7bL8qwLaFaeqb02cMU0YVL+oKDrYzH/Ng==}
|
resolution: {integrity: sha512-EY2MVHZgHp6RSudnLVoWYYP1BQvtb4nX3Vafoa4LzmME5dD8i0XLURdW29h7+87mluPdLTJLMI6wTZWEy2NFUQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@noble/hashes': 1.3.2
|
'@noble/hashes': 1.3.2
|
||||||
'@noble/secp256k1': 2.0.0
|
'@noble/secp256k1': 2.0.0
|
||||||
@ -970,6 +970,7 @@ packages:
|
|||||||
node-fetch: 3.3.2
|
node-fetch: 3.3.2
|
||||||
nostr-tools: 1.14.2
|
nostr-tools: 1.14.2
|
||||||
tsd: 0.28.1
|
tsd: 0.28.1
|
||||||
|
typescript-lru-cache: 2.0.0
|
||||||
utf8-buffer: 1.0.0
|
utf8-buffer: 1.0.0
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- eslint-import-resolver-typescript
|
- eslint-import-resolver-typescript
|
||||||
@ -978,13 +979,13 @@ packages:
|
|||||||
- typescript
|
- typescript
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@nostr-fetch/adapter-ndk@0.12.2(@nostr-dev-kit/ndk@0.8.23)(nostr-fetch@0.13.0):
|
/@nostr-fetch/adapter-ndk@0.12.2(@nostr-dev-kit/ndk@1.0.0)(nostr-fetch@0.13.0):
|
||||||
resolution: {integrity: sha512-+7EVuxS5DDZvNo6qbfFp7xRHwIyjyi36hYkiQFDjbQ4gX5LKo9RIPB1P+1XGkOSDFshypTbovZCaFunscJ/zhQ==}
|
resolution: {integrity: sha512-+7EVuxS5DDZvNo6qbfFp7xRHwIyjyi36hYkiQFDjbQ4gX5LKo9RIPB1P+1XGkOSDFshypTbovZCaFunscJ/zhQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@nostr-dev-kit/ndk': ^0.7.5
|
'@nostr-dev-kit/ndk': ^0.7.5
|
||||||
nostr-fetch: ^0.12.2
|
nostr-fetch: ^0.12.2
|
||||||
dependencies:
|
dependencies:
|
||||||
'@nostr-dev-kit/ndk': 0.8.23(typescript@5.2.2)
|
'@nostr-dev-kit/ndk': 1.0.0(typescript@5.2.2)
|
||||||
'@nostr-fetch/kernel': 0.12.2
|
'@nostr-fetch/kernel': 0.12.2
|
||||||
nostr-fetch: 0.13.0
|
nostr-fetch: 0.13.0
|
||||||
dev: false
|
dev: false
|
||||||
@ -1847,12 +1848,12 @@ packages:
|
|||||||
tailwindcss: 3.3.3
|
tailwindcss: 3.3.3
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@tanstack/query-core@4.33.0:
|
/@tanstack/query-core@4.35.0:
|
||||||
resolution: {integrity: sha512-qYu73ptvnzRh6se2nyBIDHGBQvPY1XXl3yR769B7B6mIDD7s+EZhdlWHQ67JI6UOTFRaI7wupnTnwJ3gE0Mr/g==}
|
resolution: {integrity: sha512-4GMcKQuLZQi6RFBiBZNsLhl+hQGYScRZ5ZoVq8QAzfqz9M7vcGin/2YdSESwl7WaV+Qzsb5CZOAbMBes4lNTnA==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@tanstack/react-query@4.33.0(react-dom@18.2.0)(react@18.2.0):
|
/@tanstack/react-query@4.35.0(react-dom@18.2.0)(react@18.2.0):
|
||||||
resolution: {integrity: sha512-97nGbmDK0/m0B86BdiXzx3EW9RcDYKpnyL2+WwyuLHEgpfThYAnXFaMMmnTDuAO4bQJXEhflumIEUfKmP7ESGA==}
|
resolution: {integrity: sha512-LLYDNnM9ewYHgjm2rzhk4KG/puN2rdoqCUD+N9+V7SwlsYwJk5ypX58rpkoZAhFyZ+KmFUJ7Iv2lIEOoUqydIg==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0
|
react: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||||
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
|
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||||
@ -1863,7 +1864,7 @@ packages:
|
|||||||
react-native:
|
react-native:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@tanstack/query-core': 4.33.0
|
'@tanstack/query-core': 4.35.0
|
||||||
react: 18.2.0
|
react: 18.2.0
|
||||||
react-dom: 18.2.0(react@18.2.0)
|
react-dom: 18.2.0(react@18.2.0)
|
||||||
use-sync-external-store: 1.2.0(react@18.2.0)
|
use-sync-external-store: 1.2.0(react@18.2.0)
|
||||||
@ -2455,7 +2456,7 @@ packages:
|
|||||||
ignore: 5.2.4
|
ignore: 5.2.4
|
||||||
natural-compare: 1.4.0
|
natural-compare: 1.4.0
|
||||||
semver: 7.5.4
|
semver: 7.5.4
|
||||||
ts-api-utils: 1.0.2(typescript@5.2.2)
|
ts-api-utils: 1.0.3(typescript@5.2.2)
|
||||||
typescript: 5.2.2
|
typescript: 5.2.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
@ -2552,7 +2553,7 @@ packages:
|
|||||||
'@typescript-eslint/utils': 6.6.0(eslint@8.48.0)(typescript@5.2.2)
|
'@typescript-eslint/utils': 6.6.0(eslint@8.48.0)(typescript@5.2.2)
|
||||||
debug: 4.3.4
|
debug: 4.3.4
|
||||||
eslint: 8.48.0
|
eslint: 8.48.0
|
||||||
ts-api-utils: 1.0.2(typescript@5.2.2)
|
ts-api-utils: 1.0.3(typescript@5.2.2)
|
||||||
typescript: 5.2.2
|
typescript: 5.2.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
@ -2604,7 +2605,7 @@ packages:
|
|||||||
globby: 11.1.0
|
globby: 11.1.0
|
||||||
is-glob: 4.0.3
|
is-glob: 4.0.3
|
||||||
semver: 7.5.4
|
semver: 7.5.4
|
||||||
ts-api-utils: 1.0.2(typescript@5.2.2)
|
ts-api-utils: 1.0.3(typescript@5.2.2)
|
||||||
typescript: 5.2.2
|
typescript: 5.2.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
@ -2828,8 +2829,8 @@ packages:
|
|||||||
es-abstract: 1.22.1
|
es-abstract: 1.22.1
|
||||||
es-shim-unscopables: 1.0.0
|
es-shim-unscopables: 1.0.0
|
||||||
|
|
||||||
/array.prototype.tosorted@1.1.1:
|
/array.prototype.tosorted@1.1.2:
|
||||||
resolution: {integrity: sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==}
|
resolution: {integrity: sha512-HuQCHOlk1Weat5jzStICBCd83NxiIMwqDg/dHEsoefabn/hJRj5pVdWcPUSpRrwhwxZOsQassMpgN/xRYFBMIg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
call-bind: 1.0.2
|
call-bind: 1.0.2
|
||||||
define-properties: 1.2.0
|
define-properties: 1.2.0
|
||||||
@ -2873,7 +2874,7 @@ packages:
|
|||||||
postcss: ^8.1.0
|
postcss: ^8.1.0
|
||||||
dependencies:
|
dependencies:
|
||||||
browserslist: 4.21.10
|
browserslist: 4.21.10
|
||||||
caniuse-lite: 1.0.30001527
|
caniuse-lite: 1.0.30001528
|
||||||
fraction.js: 4.3.6
|
fraction.js: 4.3.6
|
||||||
normalize-range: 0.1.2
|
normalize-range: 0.1.2
|
||||||
picocolors: 1.0.0
|
picocolors: 1.0.0
|
||||||
@ -2925,8 +2926,8 @@ packages:
|
|||||||
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dependencies:
|
dependencies:
|
||||||
caniuse-lite: 1.0.30001527
|
caniuse-lite: 1.0.30001528
|
||||||
electron-to-chromium: 1.4.509
|
electron-to-chromium: 1.4.511
|
||||||
node-releases: 2.0.13
|
node-releases: 2.0.13
|
||||||
update-browserslist-db: 1.0.11(browserslist@4.21.10)
|
update-browserslist-db: 1.0.11(browserslist@4.21.10)
|
||||||
dev: true
|
dev: true
|
||||||
@ -2960,8 +2961,8 @@ packages:
|
|||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/caniuse-lite@1.0.30001527:
|
/caniuse-lite@1.0.30001528:
|
||||||
resolution: {integrity: sha512-YkJi7RwPgWtXVSgK4lG9AHH57nSzvvOp9MesgXmw4Q7n0C3H04L0foHqfxcmSAm5AcWb8dW9AYj2tR7/5GnddQ==}
|
resolution: {integrity: sha512-0Db4yyjR9QMNlsxh+kKWzQtkyflkG/snYheSzkjmvdEtEXB1+jt7A2HmSEiO6XIJPIbo92lHNGNySvE5pZcs5Q==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/case-anything@2.1.13:
|
/case-anything@2.1.13:
|
||||||
@ -3285,8 +3286,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
|
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/electron-to-chromium@1.4.509:
|
/electron-to-chromium@1.4.511:
|
||||||
resolution: {integrity: sha512-G5KlSWY0zzhANtX15tkikHl4WB7zil2Y65oT52EZUL194abjUXBZym12Ht7Bhuwm/G3LJFEqMADyv2Cks56dmg==}
|
resolution: {integrity: sha512-udHyLfdy390CObLy3uFQitCBvK+WxWu6WZWQMBzO/npNiRy6tanDKR1c/F6OImfAiSt1ylgNszPJBxix2c0w3w==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/emoji-regex@8.0.0:
|
/emoji-regex@8.0.0:
|
||||||
@ -3353,8 +3354,8 @@ packages:
|
|||||||
regexp.prototype.flags: 1.5.0
|
regexp.prototype.flags: 1.5.0
|
||||||
safe-array-concat: 1.0.1
|
safe-array-concat: 1.0.1
|
||||||
safe-regex-test: 1.0.0
|
safe-regex-test: 1.0.0
|
||||||
string.prototype.trim: 1.2.7
|
string.prototype.trim: 1.2.8
|
||||||
string.prototype.trimend: 1.0.6
|
string.prototype.trimend: 1.0.7
|
||||||
string.prototype.trimstart: 1.0.7
|
string.prototype.trimstart: 1.0.7
|
||||||
typed-array-buffer: 1.0.0
|
typed-array-buffer: 1.0.0
|
||||||
typed-array-byte-length: 1.0.0
|
typed-array-byte-length: 1.0.0
|
||||||
@ -3624,7 +3625,7 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
array-includes: 3.1.7
|
array-includes: 3.1.7
|
||||||
array.prototype.flatmap: 1.3.2
|
array.prototype.flatmap: 1.3.2
|
||||||
array.prototype.tosorted: 1.1.1
|
array.prototype.tosorted: 1.1.2
|
||||||
doctrine: 2.1.0
|
doctrine: 2.1.0
|
||||||
es-iterator-helpers: 1.0.14
|
es-iterator-helpers: 1.0.14
|
||||||
eslint: 8.48.0
|
eslint: 8.48.0
|
||||||
@ -4407,8 +4408,8 @@ packages:
|
|||||||
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
|
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/jiti@1.19.3:
|
/jiti@1.20.0:
|
||||||
resolution: {integrity: sha512-5eEbBDQT/jF1xg6l36P+mWGGoH9Spuy0PCdSr2dtWRDGC6ph/w9ZCL4lmESW8f8F7MwT3XKescfP0wnZWAKL9w==}
|
resolution: {integrity: sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@ -6389,16 +6390,16 @@ packages:
|
|||||||
es-abstract: 1.22.1
|
es-abstract: 1.22.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/string.prototype.trim@1.2.7:
|
/string.prototype.trim@1.2.8:
|
||||||
resolution: {integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==}
|
resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
dependencies:
|
dependencies:
|
||||||
call-bind: 1.0.2
|
call-bind: 1.0.2
|
||||||
define-properties: 1.2.0
|
define-properties: 1.2.0
|
||||||
es-abstract: 1.22.1
|
es-abstract: 1.22.1
|
||||||
|
|
||||||
/string.prototype.trimend@1.0.6:
|
/string.prototype.trimend@1.0.7:
|
||||||
resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==}
|
resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
call-bind: 1.0.2
|
call-bind: 1.0.2
|
||||||
define-properties: 1.2.0
|
define-properties: 1.2.0
|
||||||
@ -6515,7 +6516,7 @@ packages:
|
|||||||
fast-glob: 3.3.1
|
fast-glob: 3.3.1
|
||||||
glob-parent: 6.0.2
|
glob-parent: 6.0.2
|
||||||
is-glob: 4.0.3
|
is-glob: 4.0.3
|
||||||
jiti: 1.19.3
|
jiti: 1.20.0
|
||||||
lilconfig: 2.1.0
|
lilconfig: 2.1.0
|
||||||
micromatch: 4.0.5
|
micromatch: 4.0.5
|
||||||
normalize-path: 3.0.0
|
normalize-path: 3.0.0
|
||||||
@ -6596,8 +6597,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==}
|
resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/ts-api-utils@1.0.2(typescript@5.2.2):
|
/ts-api-utils@1.0.3(typescript@5.2.2):
|
||||||
resolution: {integrity: sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==}
|
resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==}
|
||||||
engines: {node: '>=16.13.0'}
|
engines: {node: '>=16.13.0'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
typescript: '>=4.2.0'
|
typescript: '>=4.2.0'
|
||||||
@ -6737,6 +6738,10 @@ packages:
|
|||||||
for-each: 0.3.3
|
for-each: 0.3.3
|
||||||
is-typed-array: 1.1.12
|
is-typed-array: 1.1.12
|
||||||
|
|
||||||
|
/typescript-lru-cache@2.0.0:
|
||||||
|
resolution: {integrity: sha512-Jp57Qyy8wXeMkdNuZiglE6v2Cypg13eDA1chHwDG6kq51X7gk4K7P7HaDdzZKCxkegXkVHNcPD0n5aW6OZH3aA==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/typescript@5.2.2:
|
/typescript@5.2.2:
|
||||||
resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==}
|
resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==}
|
||||||
engines: {node: '>=14.17'}
|
engines: {node: '>=14.17'}
|
||||||
|
8
src-tauri/Cargo.lock
generated
8
src-tauri/Cargo.lock
generated
@ -545,9 +545,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bytes"
|
name = "bytes"
|
||||||
version = "1.4.0"
|
version = "1.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
|
checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
@ -695,9 +695,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono"
|
name = "chrono"
|
||||||
version = "0.4.29"
|
version = "0.4.30"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d87d9d13be47a5b7c3907137f1290b0459a7f80efb26be8c52afb11963bccb02"
|
checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android-tzdata",
|
"android-tzdata",
|
||||||
"iana-time-zone",
|
"iana-time-zone",
|
||||||
|
@ -67,7 +67,7 @@ export function CreateStep1Screen() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// save current step, if user close app and reopen it
|
// save current step, if user close app and reopen it
|
||||||
setStep('/auth/create/step-1');
|
setStep('/auth/create');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -63,7 +63,7 @@ export function CreateStep2Screen() {
|
|||||||
const dir = await appConfigDir();
|
const dir = await appConfigDir();
|
||||||
const stronghold = await Stronghold.load(`${dir}/lume.stronghold`, data.password);
|
const stronghold = await Stronghold.load(`${dir}/lume.stronghold`, data.password);
|
||||||
|
|
||||||
db.secureDB = stronghold;
|
if (!db.secureDB) db.secureDB = stronghold;
|
||||||
|
|
||||||
// save privkey to secure storage
|
// save privkey to secure storage
|
||||||
await db.secureSave(pubkey, privkey);
|
await db.secureSave(pubkey, privkey);
|
||||||
|
@ -79,7 +79,7 @@ export function ImportStep1Screen() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// save current step, if user close app and reopen it
|
// save current step, if user close app and reopen it
|
||||||
setStep('/auth/import/step-1');
|
setStep('/auth/import');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -63,7 +63,7 @@ export function ImportStep2Screen() {
|
|||||||
const dir = await appConfigDir();
|
const dir = await appConfigDir();
|
||||||
const stronghold = await Stronghold.load(`${dir}/lume.stronghold`, data.password);
|
const stronghold = await Stronghold.load(`${dir}/lume.stronghold`, data.password);
|
||||||
|
|
||||||
db.secureDB = stronghold;
|
if (!db.secureDB) db.secureDB = stronghold;
|
||||||
|
|
||||||
// save privkey to secure storage
|
// save privkey to secure storage
|
||||||
await db.secureSave(pubkey, privkey);
|
await db.secureSave(pubkey, privkey);
|
||||||
|
@ -291,6 +291,15 @@ export class LumeStorage {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async accountLogout() {
|
||||||
|
await this.db.execute("UPDATE accounts SET is_active = '0' WHERE id = $1;", [
|
||||||
|
this.account.id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
this.account = null;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public async close() {
|
public async close() {
|
||||||
return this.db.close();
|
return this.db.close();
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import { useState } from 'react';
|
|||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import { HorizontalDotsIcon } from '@shared/icons';
|
import { HorizontalDotsIcon } from '@shared/icons';
|
||||||
|
import { Logout } from '@shared/logout';
|
||||||
|
|
||||||
export function AccountMoreActions({ pubkey }: { pubkey: string }) {
|
export function AccountMoreActions({ pubkey }: { pubkey: string }) {
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
@ -44,9 +45,7 @@ export function AccountMoreActions({ pubkey }: { pubkey: string }) {
|
|||||||
</Link>
|
</Link>
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
<DropdownMenu.Item asChild>
|
<DropdownMenu.Item asChild>
|
||||||
<button className="inline-flex h-10 items-center rounded-lg px-2 text-sm font-medium text-white hover:bg-white/10">
|
<Logout />
|
||||||
Logout
|
|
||||||
</button>
|
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
</DropdownMenu.Content>
|
</DropdownMenu.Content>
|
||||||
</DropdownMenu.Portal>
|
</DropdownMenu.Portal>
|
||||||
|
@ -1,75 +1,65 @@
|
|||||||
import * as Dialog from '@radix-ui/react-dialog';
|
import * as AlertDialog from '@radix-ui/react-alert-dialog';
|
||||||
import { useQueryClient } from '@tanstack/react-query';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import { CancelIcon, LogoutIcon } from '@shared/icons';
|
import { useStorage } from '@libs/storage/provider';
|
||||||
|
|
||||||
|
import { useStronghold } from '@stores/stronghold';
|
||||||
|
|
||||||
export function Logout() {
|
export function Logout() {
|
||||||
const queryClient = useQueryClient();
|
const { db } = useStorage();
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const clearPrivkey = useStronghold((state) => state.clearPrivkey);
|
||||||
|
|
||||||
const logout = async () => {
|
const logout = async () => {
|
||||||
// reset database
|
// remove account
|
||||||
// await removeAll();
|
db.accountLogout();
|
||||||
// reset react query
|
// clear privkey in session storage
|
||||||
queryClient.clear();
|
clearPrivkey();
|
||||||
|
// redirect to welcome screen
|
||||||
|
navigate('/auth/welcome');
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Root>
|
<AlertDialog.Root>
|
||||||
<Dialog.Trigger asChild>
|
<AlertDialog.Trigger asChild>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
aria-label="Logout"
|
className="inline-flex h-10 items-center rounded-lg px-2 text-sm font-medium text-white hover:bg-white/10"
|
||||||
className="inline-flex h-9 w-9 transform items-center justify-center rounded-md bg-white/20 active:translate-y-1"
|
|
||||||
>
|
>
|
||||||
<LogoutIcon className="h-4 w-4 text-white" />
|
Logout
|
||||||
</button>
|
</button>
|
||||||
</Dialog.Trigger>
|
</AlertDialog.Trigger>
|
||||||
<Dialog.Portal className="relative z-10">
|
<AlertDialog.Portal className="relative z-10">
|
||||||
<Dialog.Overlay className="fixed inset-0 z-50 bg-black/80 backdrop-blur-xl" />
|
<AlertDialog.Overlay className="fixed inset-0 z-50 bg-black/80 backdrop-blur-2xl" />
|
||||||
<Dialog.Content className="fixed inset-0 z-50 flex min-h-full items-center justify-center">
|
<AlertDialog.Content className="fixed inset-0 z-50 flex min-h-full items-center justify-center">
|
||||||
<div className="relative h-min w-full max-w-xl rounded-xl bg-white/10 backdrop-blur-xl">
|
<div className="relative h-min w-full max-w-md rounded-xl bg-white/10 backdrop-blur-xl">
|
||||||
<div className="h-min w-full shrink-0 border-b border-white/10 bg-white/5 px-5 py-6">
|
<div className="flex flex-col gap-2 border-b border-white/5 px-5 py-4">
|
||||||
<div className="flex flex-col gap-2">
|
<AlertDialog.Title className="text-lg font-semibold leading-none text-white">
|
||||||
<div className="flex items-center justify-between">
|
Are you sure!
|
||||||
<Dialog.Title className="text-lg font-semibold leading-none text-white">
|
</AlertDialog.Title>
|
||||||
Are you sure!
|
<AlertDialog.Description className="text-sm leading-tight text-white/50">
|
||||||
</Dialog.Title>
|
You can always log back in at any time. If you just want to switch
|
||||||
<Dialog.Close className="inline-flex h-6 w-6 items-center justify-center rounded-md backdrop-blur-xl hover:bg-white/10">
|
accounts, you can do that by adding an existing account.
|
||||||
<CancelIcon className="h-4 w-4 text-white/50" />
|
</AlertDialog.Description>
|
||||||
</Dialog.Close>
|
|
||||||
</div>
|
|
||||||
<Dialog.Description className="text-sm leading-tight text-white/50">
|
|
||||||
<p className="mb-2">
|
|
||||||
When logout, all local data will be wiped, and restart app then you
|
|
||||||
need to start onboarding process again when you log in.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
In the next version, Lume will support multi account, then you can
|
|
||||||
switch between all account s instead of logout
|
|
||||||
</p>
|
|
||||||
</Dialog.Description>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex h-full w-full flex-col items-end justify-center overflow-y-auto px-5 py-2.5">
|
<div className="flex justify-end gap-2 px-5 py-3">
|
||||||
<div className="flex items-center gap-2">
|
<AlertDialog.Cancel asChild>
|
||||||
<button
|
<button className="inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium leading-none text-white outline-none hover:bg-white/10 hover:backdrop-blur-xl">
|
||||||
type="button"
|
|
||||||
className="inline-flex h-9 items-center justify-center rounded-md px-3 text-sm font-medium text-white/50 backdrop-blur-xl hover:bg-white/10"
|
|
||||||
>
|
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
</AlertDialog.Cancel>
|
||||||
type="button"
|
<button
|
||||||
onClick={() => logout()}
|
type="button"
|
||||||
className="inline-flex h-9 items-center justify-center rounded-md bg-red-500 px-3 text-sm font-medium text-white hover:bg-red-600"
|
onClick={() => logout()}
|
||||||
>
|
className="inline-flex h-9 items-center justify-center rounded-md bg-white/10 px-4 text-sm font-medium leading-none text-white outline-none hover:bg-fuchsia-500"
|
||||||
Confirm
|
>
|
||||||
</button>
|
Logout
|
||||||
</div>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Dialog.Content>
|
</AlertDialog.Content>
|
||||||
</Dialog.Portal>
|
</AlertDialog.Portal>
|
||||||
</Dialog.Root>
|
</AlertDialog.Root>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -46,26 +46,26 @@ export function NoteRepost({ id, pubkey }: { id: string; pubkey: string }) {
|
|||||||
<AlertDialog.Portal className="relative z-10">
|
<AlertDialog.Portal className="relative z-10">
|
||||||
<AlertDialog.Overlay className="fixed inset-0 z-50 bg-black/80 backdrop-blur-2xl" />
|
<AlertDialog.Overlay className="fixed inset-0 z-50 bg-black/80 backdrop-blur-2xl" />
|
||||||
<AlertDialog.Content className="fixed inset-0 z-50 flex min-h-full items-center justify-center">
|
<AlertDialog.Content className="fixed inset-0 z-50 flex min-h-full items-center justify-center">
|
||||||
<div className="relative h-min w-full max-w-xl rounded-xl bg-white/10 backdrop-blur-xl">
|
<div className="relative h-min w-full max-w-md rounded-xl bg-white/10 backdrop-blur-xl">
|
||||||
<div className="flex flex-col gap-2 border-b border-white/5 px-5 py-4">
|
<div className="flex flex-col gap-2 border-b border-white/5 px-5 py-4">
|
||||||
<AlertDialog.Title className="text-lg font-semibold leading-none text-white">
|
<AlertDialog.Title className="text-lg font-semibold leading-none text-white">
|
||||||
Confirm repost this post?
|
Confirm repost this post?
|
||||||
</AlertDialog.Title>
|
</AlertDialog.Title>
|
||||||
<AlertDialog.Description className="text-sm leading-none text-white/50">
|
<AlertDialog.Description className="text-sm leading-tight text-white/50">
|
||||||
Reposted post will be visible to your followers, and you cannot undo this
|
Reposted post will be visible to your followers, and you cannot undo this
|
||||||
action.
|
action.
|
||||||
</AlertDialog.Description>
|
</AlertDialog.Description>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-end gap-6 px-5 py-3">
|
<div className="flex justify-end gap-2 px-5 py-3">
|
||||||
<AlertDialog.Cancel asChild>
|
<AlertDialog.Cancel asChild>
|
||||||
<button className="inline-flex h-11 items-center justify-center rounded-lg bg-white/10 px-4 font-medium leading-none text-white outline-none backdrop-blur-xl">
|
<button className="inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium leading-none text-white outline-none hover:bg-white/10 hover:backdrop-blur-xl">
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
</AlertDialog.Cancel>
|
</AlertDialog.Cancel>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => submit()}
|
onClick={() => submit()}
|
||||||
className="inline-flex h-11 items-center justify-center rounded-lg bg-fuchsia-500 px-4 font-medium leading-none text-white outline-none"
|
className="inline-flex h-9 items-center justify-center rounded-md bg-white/10 px-4 text-sm font-medium leading-none text-white outline-none hover:bg-fuchsia-500"
|
||||||
>
|
>
|
||||||
Yes, repost
|
Yes, repost
|
||||||
</button>
|
</button>
|
||||||
|
@ -4,6 +4,7 @@ import { createJSONStorage, persist } from 'zustand/middleware';
|
|||||||
interface StrongholdState {
|
interface StrongholdState {
|
||||||
privkey: null | string;
|
privkey: null | string;
|
||||||
setPrivkey: (privkey: string) => void;
|
setPrivkey: (privkey: string) => void;
|
||||||
|
clearPrivkey: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useStronghold = create<StrongholdState>()(
|
export const useStronghold = create<StrongholdState>()(
|
||||||
@ -13,6 +14,9 @@ export const useStronghold = create<StrongholdState>()(
|
|||||||
setPrivkey: (privkey: string) => {
|
setPrivkey: (privkey: string) => {
|
||||||
set({ privkey: privkey });
|
set({ privkey: privkey });
|
||||||
},
|
},
|
||||||
|
clearPrivkey: () => {
|
||||||
|
set({ privkey: null });
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
name: 'stronghold',
|
name: 'stronghold',
|
||||||
|
Loading…
Reference in New Issue
Block a user