wip: refactor

This commit is contained in:
Ren Amamiya
2023-08-15 21:13:58 +07:00
parent 6e28bcdb96
commit 2d53019c10
36 changed files with 603 additions and 552 deletions

View File

@@ -19,7 +19,7 @@
"dependencies": { "dependencies": {
"@ctrl/magnet-link": "^3.1.2", "@ctrl/magnet-link": "^3.1.2",
"@headlessui/react": "^1.7.16", "@headlessui/react": "^1.7.16",
"@nostr-dev-kit/ndk": "^0.8.13", "@nostr-dev-kit/ndk": "^0.8.14",
"@nostr-fetch/adapter-ndk": "^0.11.0", "@nostr-fetch/adapter-ndk": "^0.11.0",
"@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",
@@ -29,7 +29,7 @@
"@tanstack/react-query": "^4.32.6", "@tanstack/react-query": "^4.32.6",
"@tanstack/react-query-devtools": "^4.32.6", "@tanstack/react-query-devtools": "^4.32.6",
"@tanstack/react-virtual": "3.0.0-beta.54", "@tanstack/react-virtual": "3.0.0-beta.54",
"@tauri-apps/api": "2.0.0-alpha.5", "@tauri-apps/api": "2.0.0-alpha.6",
"@tauri-apps/plugin-app": "github:tauri-apps/tauri-plugin-app#v2", "@tauri-apps/plugin-app": "github:tauri-apps/tauri-plugin-app#v2",
"@tauri-apps/plugin-autostart": "github:tauri-apps/tauri-plugin-autostart#v2", "@tauri-apps/plugin-autostart": "github:tauri-apps/tauri-plugin-autostart#v2",
"@tauri-apps/plugin-clipboard-manager": "github:tauri-apps/tauri-plugin-clipboard-manager#v2", "@tauri-apps/plugin-clipboard-manager": "github:tauri-apps/tauri-plugin-clipboard-manager#v2",

307
pnpm-lock.yaml generated
View File

@@ -8,11 +8,11 @@ dependencies:
specifier: ^1.7.16 specifier: ^1.7.16
version: 1.7.16(react-dom@18.2.0)(react@18.2.0) version: 1.7.16(react-dom@18.2.0)(react@18.2.0)
'@nostr-dev-kit/ndk': '@nostr-dev-kit/ndk':
specifier: ^0.8.13 specifier: ^0.8.14
version: 0.8.13(typescript@4.9.5) version: 0.8.14(typescript@4.9.5)
'@nostr-fetch/adapter-ndk': '@nostr-fetch/adapter-ndk':
specifier: ^0.11.0 specifier: ^0.11.0
version: 0.11.0(@nostr-dev-kit/ndk@0.8.13)(nostr-fetch@0.12.2) version: 0.11.0(@nostr-dev-kit/ndk@0.8.14)(nostr-fetch@0.12.2)
'@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.20)(react-dom@18.2.0)(react@18.2.0) version: 1.0.4(@types/react-dom@18.2.7)(@types/react@18.2.20)(react-dom@18.2.0)(react@18.2.0)
@@ -38,50 +38,50 @@ dependencies:
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)
'@tauri-apps/api': '@tauri-apps/api':
specifier: 2.0.0-alpha.5 specifier: 2.0.0-alpha.6
version: 2.0.0-alpha.5 version: 2.0.0-alpha.6
'@tauri-apps/plugin-app': '@tauri-apps/plugin-app':
specifier: github:tauri-apps/tauri-plugin-app#v2 specifier: github:tauri-apps/tauri-plugin-app#v2
version: github.com/tauri-apps/tauri-plugin-app/f8b21651dfa42f42e080488568010ff3bbeb7350 version: github.com/tauri-apps/tauri-plugin-app/1efde5f3e693927a529408f414238ad40b06c9a2
'@tauri-apps/plugin-autostart': '@tauri-apps/plugin-autostart':
specifier: github:tauri-apps/tauri-plugin-autostart#v2 specifier: github:tauri-apps/tauri-plugin-autostart#v2
version: github.com/tauri-apps/tauri-plugin-autostart/0b6ccaa31eccdeec47ca0425f7696846aa3a5f46 version: github.com/tauri-apps/tauri-plugin-autostart/50d57bf6dcac4c32e6f5a73f1b6d90001b68c6f7
'@tauri-apps/plugin-clipboard-manager': '@tauri-apps/plugin-clipboard-manager':
specifier: github:tauri-apps/tauri-plugin-clipboard-manager#v2 specifier: github:tauri-apps/tauri-plugin-clipboard-manager#v2
version: github.com/tauri-apps/tauri-plugin-clipboard-manager/32e302b07e3ea11b59c55d4fc100516ac49a4968 version: github.com/tauri-apps/tauri-plugin-clipboard-manager/f5314980a4b60362bca6b9d2a3a40a637c021d3c
'@tauri-apps/plugin-dialog': '@tauri-apps/plugin-dialog':
specifier: github:tauri-apps/tauri-plugin-dialog#v2 specifier: github:tauri-apps/tauri-plugin-dialog#v2
version: github.com/tauri-apps/tauri-plugin-dialog/2d74ae009691b50e6498fb814a77c59b6798f2ac version: github.com/tauri-apps/tauri-plugin-dialog/eece20be9c1dc257e268f5d63654af56cf4fb474
'@tauri-apps/plugin-fs': '@tauri-apps/plugin-fs':
specifier: github:tauri-apps/tauri-plugin-fs#v2 specifier: github:tauri-apps/tauri-plugin-fs#v2
version: github.com/tauri-apps/tauri-plugin-fs/0dd45ead4ca3cc8b426614fa47ad9227e9ed2053 version: github.com/tauri-apps/tauri-plugin-fs/c90fd8bcad3be92f34a0642d67ab1a6ad9f73dee
'@tauri-apps/plugin-http': '@tauri-apps/plugin-http':
specifier: github:tauri-apps/tauri-plugin-http#v2 specifier: github:tauri-apps/tauri-plugin-http#v2
version: github.com/tauri-apps/tauri-plugin-http/27b519b63419db048d2d30945ff34b2234975ccd version: github.com/tauri-apps/tauri-plugin-http/50bc7956907eef54a20255b62ea57ff4c2e8585a
'@tauri-apps/plugin-notification': '@tauri-apps/plugin-notification':
specifier: github:tauri-apps/tauri-plugin-notification#v2 specifier: github:tauri-apps/tauri-plugin-notification#v2
version: github.com/tauri-apps/tauri-plugin-notification/7878980ee8cb97437f343cc31b97a1b666e324d4 version: github.com/tauri-apps/tauri-plugin-notification/66c0779854575ec7860eadcd98673c39627e81a6
'@tauri-apps/plugin-os': '@tauri-apps/plugin-os':
specifier: github:tauri-apps/tauri-plugin-os#v2 specifier: github:tauri-apps/tauri-plugin-os#v2
version: github.com/tauri-apps/tauri-plugin-os/e4dda0ceff72cbc762937e79c104522a8866b840 version: github.com/tauri-apps/tauri-plugin-os/97469d43edd41c32aa1c0eea38d1c19d14e38f47
'@tauri-apps/plugin-process': '@tauri-apps/plugin-process':
specifier: github:tauri-apps/tauri-plugin-process#v2 specifier: github:tauri-apps/tauri-plugin-process#v2
version: github.com/tauri-apps/tauri-plugin-process/eec5dc8d37c80b2c1ebb7eb8e4cb976eed221a9d version: github.com/tauri-apps/tauri-plugin-process/7a04374b86dbc0691a7223bbdbec6b0b3d8cd3af
'@tauri-apps/plugin-shell': '@tauri-apps/plugin-shell':
specifier: github:tauri-apps/tauri-plugin-shell#v2 specifier: github:tauri-apps/tauri-plugin-shell#v2
version: github.com/tauri-apps/tauri-plugin-shell/f76cb0019364f40b9411eac5f5fdf6fd04b3e538 version: github.com/tauri-apps/tauri-plugin-shell/c8bb6d545043434cdb5784ace171c509f8b20586
'@tauri-apps/plugin-sql': '@tauri-apps/plugin-sql':
specifier: github:tauri-apps/tauri-plugin-sql#v2 specifier: github:tauri-apps/tauri-plugin-sql#v2
version: github.com/tauri-apps/tauri-plugin-sql/62eb3e4c9f084c1238cf7ab00d47148c034be207 version: github.com/tauri-apps/tauri-plugin-sql/592d8ba3640cfb3a3214fcec21b0355d3a6951ec
'@tauri-apps/plugin-store': '@tauri-apps/plugin-store':
specifier: github:tauri-apps/tauri-plugin-store#v2 specifier: github:tauri-apps/tauri-plugin-store#v2
version: github.com/tauri-apps/tauri-plugin-store/ddb10b0776a670028c1a56bbe922aba02fd32484 version: github.com/tauri-apps/tauri-plugin-store/22ed4246f7be1413852c5ab9907a773be08ad8a8
'@tauri-apps/plugin-stronghold': '@tauri-apps/plugin-stronghold':
specifier: github:tauri-apps/tauri-plugin-stronghold#v2 specifier: github:tauri-apps/tauri-plugin-stronghold#v2
version: github.com/tauri-apps/tauri-plugin-stronghold/9b2878280d1ab9da3d1a56c6f73bc1384b93f705 version: github.com/tauri-apps/tauri-plugin-stronghold/33dc99be377c7bc6b7cf4d4d1fdce28340379f63
'@tauri-apps/plugin-upload': '@tauri-apps/plugin-upload':
specifier: github:tauri-apps/tauri-plugin-upload#v2 specifier: github:tauri-apps/tauri-plugin-upload#v2
version: github.com/tauri-apps/tauri-plugin-upload/58fa4ca197cfd55292f77ede59f241014806963a version: github.com/tauri-apps/tauri-plugin-upload/c48327c9601b0097f104ddef120a1999d5b944db
'@tauri-apps/plugin-window': '@tauri-apps/plugin-window':
specifier: 2.0.0-alpha.0 specifier: 2.0.0-alpha.0
version: 2.0.0-alpha.0 version: 2.0.0-alpha.0
@@ -990,8 +990,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.13(typescript@4.9.5): /@nostr-dev-kit/ndk@0.8.14(typescript@4.9.5):
resolution: {integrity: sha512-WDDx0B3eRJWiqKbkMKTxqNPWTDShTt7IfMbZblas700Hm5DvoFb6E5jXyE4/szLM2gFf785gBXfp+rdLUfIktw==} resolution: {integrity: sha512-aVYRRAypZDrnfkWWHWK+t6W/mv9yJflwMn4gYuPKCL8qUuP98QFuCO7yVbh+cWlyVQXQa+B64BDhg/oP2AIZzA==}
dependencies: dependencies:
'@noble/hashes': 1.3.1 '@noble/hashes': 1.3.1
'@noble/secp256k1': 2.0.0 '@noble/secp256k1': 2.0.0
@@ -1019,13 +1019,13 @@ packages:
- typescript - typescript
dev: false dev: false
/@nostr-fetch/adapter-ndk@0.11.0(@nostr-dev-kit/ndk@0.8.13)(nostr-fetch@0.12.2): /@nostr-fetch/adapter-ndk@0.11.0(@nostr-dev-kit/ndk@0.8.14)(nostr-fetch@0.12.2):
resolution: {integrity: sha512-Otl7SEzm9ecqyHB10bpYXBu1qpqJEnipp7dZ4qcA9LeJAtM38fnYKUD34HX0JXA9EDjtc6VS5UNZe544xC9GCg==} resolution: {integrity: sha512-Otl7SEzm9ecqyHB10bpYXBu1qpqJEnipp7dZ4qcA9LeJAtM38fnYKUD34HX0JXA9EDjtc6VS5UNZe544xC9GCg==}
peerDependencies: peerDependencies:
'@nostr-dev-kit/ndk': ^0.5.0 '@nostr-dev-kit/ndk': ^0.5.0
nostr-fetch: ^0.11.0 nostr-fetch: ^0.11.0
dependencies: dependencies:
'@nostr-dev-kit/ndk': 0.8.13(typescript@4.9.5) '@nostr-dev-kit/ndk': 0.8.14(typescript@4.9.5)
'@nostr-fetch/kernel': 0.11.0 '@nostr-fetch/kernel': 0.11.0
nostr-fetch: 0.12.2 nostr-fetch: 0.12.2
dev: false dev: false
@@ -1832,8 +1832,8 @@ packages:
engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'} engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
dev: false dev: false
/@tauri-apps/api@2.0.0-alpha.5: /@tauri-apps/api@2.0.0-alpha.6:
resolution: {integrity: sha512-OqysC4c819itGxic50RoDMrmd+ofX+MMNkXKeRS0BV2rkKqrnuV17o3TrQXFI1xs/kXRmmPC+3Y42P9Y5uNvRg==} resolution: {integrity: sha512-ZMOc3eu9amwvkC6M69h3hWt4/EsFaAXmtkiw4xd2LN59/lTb4ZQiVfq2QKlRcu1rj3n/Tcr7U30ZopvHwXBGIg==}
engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'} engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
dev: false dev: false
@@ -2788,7 +2788,7 @@ packages:
hasBin: true hasBin: true
dependencies: dependencies:
caniuse-lite: 1.0.30001520 caniuse-lite: 1.0.30001520
electron-to-chromium: 1.4.490 electron-to-chromium: 1.4.491
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
@@ -2801,20 +2801,20 @@ packages:
node-gyp-build: 4.6.0 node-gyp-build: 4.6.0
dev: false dev: false
/cacache@17.1.3: /cacache@17.1.4:
resolution: {integrity: sha512-jAdjGxmPxZh0IipMdR7fK/4sDSrHMLUV0+GvVUsjwyGNKHsh79kW/otg+GkbXwl6Uzvy9wsvHOX4nUoWldeZMg==} resolution: {integrity: sha512-/aJwG2l3ZMJ1xNAnqbMpA40of9dj/pIH3QfiuQSqjfPJF747VR0J/bHn+/KdNnHKc6XQcWt/AfRSBft82W1d2A==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
dependencies: dependencies:
'@npmcli/fs': 3.1.0 '@npmcli/fs': 3.1.0
fs-minipass: 3.0.2 fs-minipass: 3.0.3
glob: 10.3.3 glob: 10.3.3
lru-cache: 7.18.3 lru-cache: 7.18.3
minipass: 5.0.0 minipass: 7.0.3
minipass-collect: 1.0.2 minipass-collect: 1.0.2
minipass-flush: 1.0.5 minipass-flush: 1.0.5
minipass-pipeline: 1.2.4 minipass-pipeline: 1.2.4
p-map: 4.0.0 p-map: 4.0.0
ssri: 10.0.4 ssri: 10.0.5
tar: 6.1.15 tar: 6.1.15
unique-filename: 3.0.0 unique-filename: 3.0.0
dev: false dev: false
@@ -3208,8 +3208,8 @@ packages:
/eastasianwidth@0.2.0: /eastasianwidth@0.2.0:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
/electron-to-chromium@1.4.490: /electron-to-chromium@1.4.491:
resolution: {integrity: sha512-6s7NVJz+sATdYnIwhdshx/N/9O6rvMxmhVoDSDFdj6iA45gHR8EQje70+RYsF4GeB+k0IeNSBnP7yG9ZXJFr7A==} resolution: {integrity: sha512-ZzPqGKghdVzlQJ+qpfE+r6EB321zed7e5JsvHIlMM4zPFF8okXUkF5Of7h7F3l3cltPL0rG7YVmlp5Qro7RQLA==}
dev: true dev: true
/emoji-regex@8.0.0: /emoji-regex@8.0.0:
@@ -3815,11 +3815,11 @@ packages:
minipass: 3.3.6 minipass: 3.3.6
dev: false dev: false
/fs-minipass@3.0.2: /fs-minipass@3.0.3:
resolution: {integrity: sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g==} resolution: {integrity: sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
dependencies: dependencies:
minipass: 5.0.0 minipass: 7.0.3
dev: false dev: false
/fs.realpath@1.0.0: /fs.realpath@1.0.0:
@@ -3918,7 +3918,7 @@ packages:
foreground-child: 3.1.1 foreground-child: 3.1.1
jackspeak: 2.2.3 jackspeak: 2.2.3
minimatch: 9.0.3 minimatch: 9.0.3
minipass: 5.0.0 minipass: 7.0.3
path-scurry: 1.10.1 path-scurry: 1.10.1
dev: false dev: false
@@ -4629,20 +4629,20 @@ packages:
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
dependencies: dependencies:
agentkeepalive: 4.5.0 agentkeepalive: 4.5.0
cacache: 17.1.3 cacache: 17.1.4
http-cache-semantics: 4.1.1 http-cache-semantics: 4.1.1
http-proxy-agent: 5.0.0 http-proxy-agent: 5.0.0
https-proxy-agent: 5.0.1 https-proxy-agent: 5.0.1
is-lambda: 1.0.1 is-lambda: 1.0.1
lru-cache: 7.18.3 lru-cache: 7.18.3
minipass: 5.0.0 minipass: 5.0.0
minipass-fetch: 3.0.3 minipass-fetch: 3.0.4
minipass-flush: 1.0.5 minipass-flush: 1.0.5
minipass-pipeline: 1.2.4 minipass-pipeline: 1.2.4
negotiator: 0.6.3 negotiator: 0.6.3
promise-retry: 2.0.1 promise-retry: 2.0.1
socks-proxy-agent: 7.0.0 socks-proxy-agent: 7.0.0
ssri: 10.0.4 ssri: 10.0.5
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
dev: false dev: false
@@ -5143,11 +5143,11 @@ packages:
minipass: 3.3.6 minipass: 3.3.6
dev: false dev: false
/minipass-fetch@3.0.3: /minipass-fetch@3.0.4:
resolution: {integrity: sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ==} resolution: {integrity: sha512-jHAqnA728uUpIaFm7NWsCnqKT6UqZz7GcI/bDpPATuwYyKwJwW0remxSCxUlKiEty+eopHGa3oc8WxgQ1FFJqg==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
dependencies: dependencies:
minipass: 5.0.0 minipass: 7.0.3
minipass-sized: 1.0.3 minipass-sized: 1.0.3
minizlib: 2.1.2 minizlib: 2.1.2
optionalDependencies: optionalDependencies:
@@ -5187,6 +5187,11 @@ packages:
engines: {node: '>=8'} engines: {node: '>=8'}
dev: false dev: false
/minipass@7.0.3:
resolution: {integrity: sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==}
engines: {node: '>=16 || 14 >=14.17'}
dev: false
/minizlib@2.1.2: /minizlib@2.1.2:
resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
engines: {node: '>= 8'} engines: {node: '>= 8'}
@@ -5601,7 +5606,7 @@ packages:
engines: {node: '>=16 || 14 >=14.17'} engines: {node: '>=16 || 14 >=14.17'}
dependencies: dependencies:
lru-cache: 10.0.1 lru-cache: 10.0.1
minipass: 5.0.0 minipass: 7.0.3
dev: false dev: false
/path-type@3.0.0: /path-type@3.0.0:
@@ -6532,11 +6537,11 @@ packages:
resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==}
dev: false dev: false
/ssri@10.0.4: /ssri@10.0.5:
resolution: {integrity: sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==} resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
dependencies: dependencies:
minipass: 5.0.0 minipass: 7.0.3
dev: false dev: false
/string-argv@0.3.2: /string-argv@0.3.2:
@@ -7361,114 +7366,114 @@ packages:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
dev: false dev: false
github.com/tauri-apps/tauri-plugin-app/f8b21651dfa42f42e080488568010ff3bbeb7350: github.com/tauri-apps/tauri-plugin-app/1efde5f3e693927a529408f414238ad40b06c9a2:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-app/tar.gz/f8b21651dfa42f42e080488568010ff3bbeb7350} resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-app/tar.gz/1efde5f3e693927a529408f414238ad40b06c9a2}
name: '@tauri-apps/plugin-app' name: '@tauri-apps/plugin-app'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-autostart/0b6ccaa31eccdeec47ca0425f7696846aa3a5f46:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-autostart/tar.gz/0b6ccaa31eccdeec47ca0425f7696846aa3a5f46}
name: '@tauri-apps/plugin-autostart'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-clipboard-manager/32e302b07e3ea11b59c55d4fc100516ac49a4968:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-clipboard-manager/tar.gz/32e302b07e3ea11b59c55d4fc100516ac49a4968}
name: '@tauri-apps/plugin-clipboard-manager'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-dialog/2d74ae009691b50e6498fb814a77c59b6798f2ac:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-dialog/tar.gz/2d74ae009691b50e6498fb814a77c59b6798f2ac}
name: '@tauri-apps/plugin-dialog'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-fs/0dd45ead4ca3cc8b426614fa47ad9227e9ed2053:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-fs/tar.gz/0dd45ead4ca3cc8b426614fa47ad9227e9ed2053}
name: '@tauri-apps/plugin-fs'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-http/27b519b63419db048d2d30945ff34b2234975ccd:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-http/tar.gz/27b519b63419db048d2d30945ff34b2234975ccd}
name: '@tauri-apps/plugin-http'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-notification/7878980ee8cb97437f343cc31b97a1b666e324d4:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-notification/tar.gz/7878980ee8cb97437f343cc31b97a1b666e324d4}
name: '@tauri-apps/plugin-notification'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-os/e4dda0ceff72cbc762937e79c104522a8866b840:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-os/tar.gz/e4dda0ceff72cbc762937e79c104522a8866b840}
name: '@tauri-apps/plugin-os'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-process/eec5dc8d37c80b2c1ebb7eb8e4cb976eed221a9d:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-process/tar.gz/eec5dc8d37c80b2c1ebb7eb8e4cb976eed221a9d}
name: '@tauri-apps/plugin-process'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-shell/f76cb0019364f40b9411eac5f5fdf6fd04b3e538:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-shell/tar.gz/f76cb0019364f40b9411eac5f5fdf6fd04b3e538}
name: '@tauri-apps/plugin-shell'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-sql/62eb3e4c9f084c1238cf7ab00d47148c034be207:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/62eb3e4c9f084c1238cf7ab00d47148c034be207}
name: '@tauri-apps/plugin-sql'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-store/ddb10b0776a670028c1a56bbe922aba02fd32484:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-store/tar.gz/ddb10b0776a670028c1a56bbe922aba02fd32484}
name: '@tauri-apps/plugin-store'
version: 2.0.0-alpha.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
dev: false
github.com/tauri-apps/tauri-plugin-stronghold/9b2878280d1ab9da3d1a56c6f73bc1384b93f705:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-stronghold/tar.gz/9b2878280d1ab9da3d1a56c6f73bc1384b93f705}
name: '@tauri-apps/plugin-stronghold'
version: 2.0.0-alpha.1 version: 2.0.0-alpha.1
dependencies: dependencies:
'@tauri-apps/api': 2.0.0-alpha.5 '@tauri-apps/api': 2.0.0-alpha.6
dev: false dev: false
github.com/tauri-apps/tauri-plugin-upload/58fa4ca197cfd55292f77ede59f241014806963a: github.com/tauri-apps/tauri-plugin-autostart/50d57bf6dcac4c32e6f5a73f1b6d90001b68c6f7:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-upload/tar.gz/58fa4ca197cfd55292f77ede59f241014806963a} resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-autostart/tar.gz/50d57bf6dcac4c32e6f5a73f1b6d90001b68c6f7}
name: '@tauri-apps/plugin-upload' name: '@tauri-apps/plugin-autostart'
version: 2.0.0-alpha.0 version: 2.0.0-alpha.1
dependencies: dependencies:
'@tauri-apps/api': 2.0.0-alpha.5 '@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-clipboard-manager/f5314980a4b60362bca6b9d2a3a40a637c021d3c:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-clipboard-manager/tar.gz/f5314980a4b60362bca6b9d2a3a40a637c021d3c}
name: '@tauri-apps/plugin-clipboard-manager'
version: 2.0.0-alpha.1
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-dialog/eece20be9c1dc257e268f5d63654af56cf4fb474:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-dialog/tar.gz/eece20be9c1dc257e268f5d63654af56cf4fb474}
name: '@tauri-apps/plugin-dialog'
version: 2.0.0-alpha.1
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-fs/c90fd8bcad3be92f34a0642d67ab1a6ad9f73dee:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-fs/tar.gz/c90fd8bcad3be92f34a0642d67ab1a6ad9f73dee}
name: '@tauri-apps/plugin-fs'
version: 2.0.0-alpha.1
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-http/50bc7956907eef54a20255b62ea57ff4c2e8585a:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-http/tar.gz/50bc7956907eef54a20255b62ea57ff4c2e8585a}
name: '@tauri-apps/plugin-http'
version: 2.0.0-alpha.1
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-notification/66c0779854575ec7860eadcd98673c39627e81a6:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-notification/tar.gz/66c0779854575ec7860eadcd98673c39627e81a6}
name: '@tauri-apps/plugin-notification'
version: 2.0.0-alpha.1
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-os/97469d43edd41c32aa1c0eea38d1c19d14e38f47:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-os/tar.gz/97469d43edd41c32aa1c0eea38d1c19d14e38f47}
name: '@tauri-apps/plugin-os'
version: 2.0.0-alpha.2
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-process/7a04374b86dbc0691a7223bbdbec6b0b3d8cd3af:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-process/tar.gz/7a04374b86dbc0691a7223bbdbec6b0b3d8cd3af}
name: '@tauri-apps/plugin-process'
version: 2.0.0-alpha.1
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-shell/c8bb6d545043434cdb5784ace171c509f8b20586:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-shell/tar.gz/c8bb6d545043434cdb5784ace171c509f8b20586}
name: '@tauri-apps/plugin-shell'
version: 2.0.0-alpha.1
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-sql/592d8ba3640cfb3a3214fcec21b0355d3a6951ec:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/592d8ba3640cfb3a3214fcec21b0355d3a6951ec}
name: '@tauri-apps/plugin-sql'
version: 2.0.0-alpha.1
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-store/22ed4246f7be1413852c5ab9907a773be08ad8a8:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-store/tar.gz/22ed4246f7be1413852c5ab9907a773be08ad8a8}
name: '@tauri-apps/plugin-store'
version: 2.0.0-alpha.1
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-stronghold/33dc99be377c7bc6b7cf4d4d1fdce28340379f63:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-stronghold/tar.gz/33dc99be377c7bc6b7cf4d4d1fdce28340379f63}
name: '@tauri-apps/plugin-stronghold'
version: 2.0.0-alpha.2
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false
github.com/tauri-apps/tauri-plugin-upload/c48327c9601b0097f104ddef120a1999d5b944db:
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-upload/tar.gz/c48327c9601b0097f104ddef120a1999d5b944db}
name: '@tauri-apps/plugin-upload'
version: 2.0.0-alpha.1
dependencies:
'@tauri-apps/api': 2.0.0-alpha.6
dev: false dev: false

390
src-tauri/Cargo.lock generated
View File

@@ -88,9 +88,9 @@ dependencies = [
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "1.0.3" version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b8f9420f797f2d9e935edf629310eb938a0d839f984e25327f3c7eed22300c" checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@@ -182,9 +182,9 @@ dependencies = [
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.72" version = "1.0.73"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" checksum = "f768393e7fabd388fe8409b13faa4d93ab0fef35db1508438dfdb066918bcf38"
[[package]] [[package]]
name = "arboard" name = "arboard"
@@ -1543,9 +1543,9 @@ dependencies = [
[[package]] [[package]]
name = "flate2" name = "flate2"
version = "1.0.26" version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010"
dependencies = [ dependencies = [
"crc32fast", "crc32fast",
"miniz_oxide", "miniz_oxide",
@@ -1880,7 +1880,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818"
dependencies = [ dependencies = [
"libc", "libc",
"windows-targets 0.48.1", "windows-targets 0.48.2",
] ]
[[package]] [[package]]
@@ -2170,20 +2170,6 @@ dependencies = [
"windows-sys 0.48.0", "windows-sys 0.48.0",
] ]
[[package]]
name = "html5ever"
version = "0.25.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5c13fb08e5d4dfc151ee5e88bae63f7773d61852f3bdc73c9f4b9e1bde03148"
dependencies = [
"log",
"mac",
"markup5ever 0.10.1",
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]] [[package]]
name = "html5ever" name = "html5ever"
version = "0.26.0" version = "0.26.0"
@@ -2192,7 +2178,7 @@ checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7"
dependencies = [ dependencies = [
"log", "log",
"mac", "mac",
"markup5ever 0.11.0", "markup5ever",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.109", "syn 1.0.109",
@@ -2498,9 +2484,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
[[package]] [[package]]
name = "javascriptcore-rs" name = "javascriptcore-rs"
version = "0.17.0" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "110b9902c80c12bf113c432d0b71c7a94490b294a8234f326fd0abca2fac0b00" checksum = "4cfcc681b896b083864a4a3c3b3ea196f14ff66b8641a68fde209c6d84434056"
dependencies = [ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
"glib", "glib",
@@ -2509,9 +2495,9 @@ dependencies = [
[[package]] [[package]]
name = "javascriptcore-rs-sys" name = "javascriptcore-rs-sys"
version = "0.5.1" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98a216519a52cd941a733a0ad3f1023cfdb1cd47f3955e8e863ed56f558f916c" checksum = "b0983ba5b3ab9a0c0918de02c42dc71f795d6de08092f88a98ce9fdfdee4ba91"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
@@ -2521,16 +2507,18 @@ dependencies = [
[[package]] [[package]]
name = "jni" name = "jni"
version = "0.20.0" version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97"
dependencies = [ dependencies = [
"cesu8", "cesu8",
"cfg-if",
"combine", "combine",
"jni-sys", "jni-sys",
"log", "log",
"thiserror", "thiserror",
"walkdir", "walkdir",
"windows-sys 0.45.0",
] ]
[[package]] [[package]]
@@ -2576,13 +2564,25 @@ dependencies = [
] ]
[[package]] [[package]]
name = "kuchiki" name = "keyboard-types"
version = "0.8.1" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ea8e9c6e031377cff82ee3001dc8026cdf431ed4e2e6b51f98ab8c73484a358" checksum = "0b7668b7cff6a51fe61cdde64cd27c8a220786f399501b57ebe36f7d8112fd68"
dependencies = [
"bitflags 1.3.2",
"serde",
"unicode-segmentation",
]
[[package]]
name = "kuchikiki"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f29e4755b7b995046f510a7520c42b2fed58b77bd94d5a87a8eb43d2fd126da8"
dependencies = [ dependencies = [
"cssparser", "cssparser",
"html5ever 0.25.2", "html5ever",
"indexmap 1.9.3",
"matches", "matches",
"selectors", "selectors",
] ]
@@ -2789,20 +2789,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "markup5ever"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a24f40fb03852d1cdd84330cddcaf98e9ec08a7b7768e952fad3b4cf048ec8fd"
dependencies = [
"log",
"phf 0.8.0",
"phf_codegen 0.8.0",
"string_cache",
"string_cache_codegen",
"tendril",
]
[[package]] [[package]]
name = "markup5ever" name = "markup5ever"
version = "0.11.0" version = "0.11.0"
@@ -2823,8 +2809,8 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9521dd6750f8e80ee6c53d65e2e4656d7de37064f3a7a5d2d11d05df93839c2" checksum = "b9521dd6750f8e80ee6c53d65e2e4656d7de37064f3a7a5d2d11d05df93839c2"
dependencies = [ dependencies = [
"html5ever 0.26.0", "html5ever",
"markup5ever 0.11.0", "markup5ever",
"tendril", "tendril",
"xml5ever", "xml5ever",
] ]
@@ -2926,15 +2912,35 @@ dependencies = [
] ]
[[package]] [[package]]
name = "ndk" name = "muda"
version = "0.6.0" version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" checksum = "47e33f46fb20f85553edb85e30a6a5231567f4103276ccdb5a2050613d253b1d"
dependencies = [
"cocoa 0.25.0",
"crossbeam-channel",
"gdk",
"gdk-pixbuf",
"gtk",
"keyboard-types",
"objc",
"once_cell",
"png",
"thiserror",
"windows-sys 0.48.0",
]
[[package]]
name = "ndk"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0"
dependencies = [ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
"jni-sys", "jni-sys",
"ndk-sys", "ndk-sys",
"num_enum", "num_enum",
"raw-window-handle",
"thiserror", "thiserror",
] ]
@@ -2946,9 +2952,9 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
[[package]] [[package]]
name = "ndk-sys" name = "ndk-sys"
version = "0.3.0" version = "0.4.1+23.1.7779620"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3"
dependencies = [ dependencies = [
"jni-sys", "jni-sys",
] ]
@@ -3313,7 +3319,7 @@ dependencies = [
"libc", "libc",
"redox_syscall 0.3.5", "redox_syscall 0.3.5",
"smallvec", "smallvec",
"windows-targets 0.48.1", "windows-targets 0.48.2",
] ]
[[package]] [[package]]
@@ -4759,9 +4765,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]] [[package]]
name = "state" name = "state"
version = "0.5.3" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8"
dependencies = [ dependencies = [
"loom", "loom",
] ]
@@ -4942,9 +4948,9 @@ dependencies = [
[[package]] [[package]]
name = "tao" name = "tao"
version = "0.19.1" version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "746ae5d0ca57ae275a792f109f6e992e0b41a443abdf3f5c6eff179ef5b3443a" checksum = "60279ecb16c33a6cef45cd37a9602455c190942d20e360bd8499bff49f2a48f3"
dependencies = [ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
"cairo-rs", "cairo-rs",
@@ -4953,7 +4959,6 @@ dependencies = [
"core-foundation", "core-foundation",
"core-graphics 0.22.3", "core-graphics 0.22.3",
"crossbeam-channel", "crossbeam-channel",
"dirs-next",
"dispatch", "dispatch",
"gdk", "gdk",
"gdk-pixbuf", "gdk-pixbuf",
@@ -4968,7 +4973,6 @@ dependencies = [
"instant", "instant",
"jni", "jni",
"lazy_static", "lazy_static",
"libappindicator",
"libc", "libc",
"log", "log",
"ndk", "ndk",
@@ -4983,10 +4987,12 @@ dependencies = [
"serde", "serde",
"tao-macros", "tao-macros",
"unicode-segmentation", "unicode-segmentation",
"url",
"uuid", "uuid",
"windows 0.44.0", "windows 0.48.0",
"windows-implement", "windows-implement",
"x11-dl", "x11-dl",
"zbus",
] ]
[[package]] [[package]]
@@ -5019,13 +5025,13 @@ checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a"
[[package]] [[package]]
name = "tauri" name = "tauri"
version = "2.0.0-alpha.10" version = "2.0.0-alpha.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e18377a75e314aa1d476896af881ed63f57a78ca84889fe63e69067f0de158d" checksum = "fad0a5c32ce9e3e9862fb8cd433abf63e65ffea9b80dcc44d3d991e6794ea9a6"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
"cocoa 0.24.1", "cocoa 0.25.0",
"dirs-next", "dirs-next",
"embed_plist", "embed_plist",
"futures-util", "futures-util",
@@ -5037,13 +5043,14 @@ dependencies = [
"jni", "jni",
"libc", "libc",
"log", "log",
"mime",
"muda",
"objc", "objc",
"once_cell", "once_cell",
"percent-encoding", "percent-encoding",
"rand 0.8.5", "rand 0.8.5",
"raw-window-handle", "raw-window-handle",
"reqwest", "reqwest",
"semver",
"serde", "serde",
"serde_json", "serde_json",
"serde_repr", "serde_repr",
@@ -5055,26 +5062,27 @@ dependencies = [
"tauri-runtime", "tauri-runtime",
"tauri-runtime-wry", "tauri-runtime-wry",
"tauri-utils", "tauri-utils",
"tempfile",
"thiserror", "thiserror",
"tokio", "tokio",
"tray-icon",
"url", "url",
"uuid", "uuid",
"webkit2gtk", "webkit2gtk",
"webview2-com", "webview2-com",
"windows 0.44.0", "windows 0.48.0",
] ]
[[package]] [[package]]
name = "tauri-build" name = "tauri-build"
version = "2.0.0-alpha.6" version = "2.0.0-alpha.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a52990870fd043f1d3bd6719ae713ef2e0c50431334d7249f6ae8509d1b8c326" checksum = "dc47d3c84f4aeac397cd956267f3b8060c5a2dba78288a5ccf9a8b7a8c1e7025"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"cargo_toml", "cargo_toml",
"heck", "heck",
"json-patch", "json-patch",
"plist",
"semver", "semver",
"serde", "serde",
"serde_json", "serde_json",
@@ -5086,9 +5094,9 @@ dependencies = [
[[package]] [[package]]
name = "tauri-codegen" name = "tauri-codegen"
version = "2.0.0-alpha.6" version = "2.0.0-alpha.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c1f1611ab0896f2693163ba4e8f3e39c02a1b70cdca4314286b5e365a5e08c6" checksum = "7f98a67c7ef3cb3c25de91fe1fa16cc3681997f6ec99da0a7496d6feae2ea91e"
dependencies = [ dependencies = [
"base64 0.21.2", "base64 0.21.2",
"brotli", "brotli",
@@ -5112,9 +5120,9 @@ dependencies = [
[[package]] [[package]]
name = "tauri-macros" name = "tauri-macros"
version = "2.0.0-alpha.6" version = "2.0.0-alpha.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22752425c6dd6f3a058f376db7371f1d5bac250e340d40ba6c97ecf7182eef29" checksum = "b01cb5f945c71e040c5d191c32598565ae26cc266a9d5d4f7dd2dc324c5cfdd0"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",
@@ -5126,16 +5134,16 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-app" name = "tauri-plugin-app"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"tauri", "tauri",
] ]
[[package]] [[package]]
name = "tauri-plugin-autostart" name = "tauri-plugin-autostart"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"auto-launch", "auto-launch",
"log", "log",
@@ -5147,8 +5155,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-clipboard-manager" name = "tauri-plugin-clipboard-manager"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"arboard", "arboard",
"log", "log",
@@ -5161,8 +5169,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-dialog" name = "tauri-plugin-dialog"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"glib", "glib",
"log", "log",
@@ -5178,8 +5186,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-fs" name = "tauri-plugin-fs"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"glob", "glob",
@@ -5191,8 +5199,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-http" name = "tauri-plugin-http"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.2"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"data-url", "data-url",
"glob", "glob",
@@ -5208,8 +5216,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-notification" name = "tauri-plugin-notification"
version = "2.0.0-alpha.1" version = "2.0.0-alpha.2"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"log", "log",
"notify-rust", "notify-rust",
@@ -5226,8 +5234,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-os" name = "tauri-plugin-os"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"gethostname 0.4.3", "gethostname 0.4.3",
"log", "log",
@@ -5242,16 +5250,16 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-process" name = "tauri-plugin-process"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"tauri", "tauri",
] ]
[[package]] [[package]]
name = "tauri-plugin-shell" name = "tauri-plugin-shell"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"encoding_rs", "encoding_rs",
"log", "log",
@@ -5267,8 +5275,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-single-instance" name = "tauri-plugin-single-instance"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"log", "log",
"serde", "serde",
@@ -5281,8 +5289,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-sql" name = "tauri-plugin-sql"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"log", "log",
@@ -5297,8 +5305,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-store" name = "tauri-plugin-store"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"log", "log",
"serde", "serde",
@@ -5309,8 +5317,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-stronghold" name = "tauri-plugin-stronghold"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"hex", "hex",
"iota-crypto 0.23.0", "iota-crypto 0.23.0",
@@ -5325,8 +5333,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-updater" name = "tauri-plugin-updater"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"base64 0.21.2", "base64 0.21.2",
"dirs-next", "dirs-next",
@@ -5350,8 +5358,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-upload" name = "tauri-plugin-upload"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"futures-util", "futures-util",
"log", "log",
@@ -5367,8 +5375,8 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-window" name = "tauri-plugin-window"
version = "2.0.0-alpha.0" version = "2.0.0-alpha.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab"
dependencies = [ dependencies = [
"serde", "serde",
"tauri", "tauri",
@@ -5377,9 +5385,9 @@ dependencies = [
[[package]] [[package]]
name = "tauri-runtime" name = "tauri-runtime"
version = "0.13.0-alpha.6" version = "1.0.0-alpha.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7ce19f1309299bbc38ee9236307fad4943bd8fb09dd3fea5e9dd93c1d0898d6" checksum = "f5ba2ea1c0b7a2c3e53259edc3c78527e9f40fa7b45f73c52ab5165e42f9d18a"
dependencies = [ dependencies = [
"gtk", "gtk",
"http", "http",
@@ -5393,14 +5401,14 @@ dependencies = [
"thiserror", "thiserror",
"url", "url",
"uuid", "uuid",
"windows 0.44.0", "windows 0.48.0",
] ]
[[package]] [[package]]
name = "tauri-runtime-wry" name = "tauri-runtime-wry"
version = "0.13.0-alpha.6" version = "1.0.0-alpha.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1231be42085f3a8b150e615601f8a070bd16bf579771a5dafe2931970a05b518" checksum = "095d8a6cb312211bd0ed6b51f078be2e5bba4e3244b5fdbe39fce2ebfc0d7a15"
dependencies = [ dependencies = [
"cocoa 0.24.1", "cocoa 0.24.1",
"gtk", "gtk",
@@ -5413,25 +5421,25 @@ dependencies = [
"uuid", "uuid",
"webkit2gtk", "webkit2gtk",
"webview2-com", "webview2-com",
"windows 0.44.0", "windows 0.48.0",
"wry", "wry",
] ]
[[package]] [[package]]
name = "tauri-utils" name = "tauri-utils"
version = "2.0.0-alpha.6" version = "2.0.0-alpha.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e2812e0cdfffb892c654555b2f1b8c84a035b4c56eb1646cb3eb5a9d8164d8e" checksum = "06bcd7c6f67fd6371dcc22da7d7f26ec12c4eae26ad7bc54943bb9f35b5db302"
dependencies = [ dependencies = [
"brotli", "brotli",
"ctor", "ctor",
"dunce", "dunce",
"glob", "glob",
"heck", "heck",
"html5ever 0.25.2", "html5ever",
"infer", "infer",
"json-patch", "json-patch",
"kuchiki", "kuchikiki",
"memchr", "memchr",
"phf 0.10.1", "phf 0.10.1",
"proc-macro2", "proc-macro2",
@@ -5443,7 +5451,7 @@ dependencies = [
"thiserror", "thiserror",
"url", "url",
"walkdir", "walkdir",
"windows 0.44.0", "windows 0.48.0",
] ]
[[package]] [[package]]
@@ -5498,18 +5506,18 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c"
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.44" version = "1.0.45"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" checksum = "dedd246497092a89beedfe2c9f176d44c1b672ea6090edc20544ade01fbb7ea0"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.44" version = "1.0.45"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" checksum = "7d7b1fadccbbc7e19ea64708629f9d8dccd007c260d66485f20a6d41bc1cf4b3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -5736,6 +5744,25 @@ dependencies = [
"tracing-log", "tracing-log",
] ]
[[package]]
name = "tray-icon"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3b0e5bec13da15e62330e9bcf8b9fd42489b5acfe29ac8fec7ed659dbee21d9"
dependencies = [
"cocoa 0.25.0",
"core-graphics 0.23.1",
"crossbeam-channel",
"dirs-next",
"libappindicator",
"muda",
"objc",
"once_cell",
"png",
"thiserror",
"windows-sys 0.48.0",
]
[[package]] [[package]]
name = "treediff" name = "treediff"
version = "4.0.2" version = "4.0.2"
@@ -6027,9 +6054,9 @@ dependencies = [
[[package]] [[package]]
name = "webkit2gtk" name = "webkit2gtk"
version = "0.19.2" version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8eea819afe15eb8dcdff4f19d8bfda540bae84d874c10e6f4b8faf2d6704bd1" checksum = "3ba4cce9085e0fb02575cfd45c328740dde78253cba516b1e8be2ca0f57bd8bf"
dependencies = [ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
"cairo-rs", "cairo-rs",
@@ -6051,9 +6078,9 @@ dependencies = [
[[package]] [[package]]
name = "webkit2gtk-sys" name = "webkit2gtk-sys"
version = "0.19.1" version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0ac7a95ddd3fdfcaf83d8e513b4b1ad101b95b413b6aa6662ed95f284fc3d5b" checksum = "f4489eb24e8cf0a3d0555fd3a8f7adec2a5ece34c1e7b7c9a62da7822fd40a59"
dependencies = [ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
"cairo-sys-rs", "cairo-sys-rs",
@@ -6076,7 +6103,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8598785beeb5af95abe95e7bb20c7e747d1188347080d6811d5a56d2b9a5f368" checksum = "8598785beeb5af95abe95e7bb20c7e747d1188347080d6811d5a56d2b9a5f368"
dependencies = [ dependencies = [
"curl", "curl",
"html5ever 0.26.0", "html5ever",
"markup5ever_rcdom", "markup5ever_rcdom",
"serde", "serde",
"serde_json", "serde_json",
@@ -6093,38 +6120,39 @@ dependencies = [
[[package]] [[package]]
name = "webview2-com" name = "webview2-com"
version = "0.22.1" version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11296e5daf3a653b79bf47d66c380e4143d5b9c975818871179a3bda79499562" checksum = "79e563ffe8e84d42e43ffacbace8780c0244fc8910346f334613559d92e203ad"
dependencies = [ dependencies = [
"webview2-com-macros", "webview2-com-macros",
"webview2-com-sys", "webview2-com-sys",
"windows 0.44.0", "windows 0.48.0",
"windows-implement", "windows-implement",
"windows-interface",
] ]
[[package]] [[package]]
name = "webview2-com-macros" name = "webview2-com-macros"
version = "0.6.0" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.109", "syn 2.0.28",
] ]
[[package]] [[package]]
name = "webview2-com-sys" name = "webview2-com-sys"
version = "0.22.1" version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cde542bed28058a5b028d459689ee57f1d06685bb6c266da3b91b1be6703952f" checksum = "19d39576804304cf9ead192467ef47f7859a1a12fec3bd459d5ba34b8cd65ed5"
dependencies = [ dependencies = [
"regex", "regex",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror",
"windows 0.44.0", "windows 0.48.0",
"windows-bindgen", "windows-bindgen",
"windows-metadata", "windows-metadata",
] ]
@@ -6184,7 +6212,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]] [[package]]
name = "window-vibrancy" name = "window-vibrancy"
version = "0.4.0" version = "0.4.0"
source = "git+https://github.com/tauri-apps/window-vibrancy?branch=dev#c463a8b324e7a3fac18a006bcc92b27fc3d97a04" source = "git+https://github.com/tauri-apps/window-vibrancy?branch=dev#98dc472a7f96bfba595c74b009073bd2c7b28339"
dependencies = [ dependencies = [
"cocoa 0.25.0", "cocoa 0.25.0",
"objc", "objc",
@@ -6224,8 +6252,6 @@ version = "0.44.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b"
dependencies = [ dependencies = [
"windows-implement",
"windows-interface",
"windows-targets 0.42.2", "windows-targets 0.42.2",
] ]
@@ -6235,14 +6261,16 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
dependencies = [ dependencies = [
"windows-targets 0.48.1", "windows-implement",
"windows-interface",
"windows-targets 0.48.2",
] ]
[[package]] [[package]]
name = "windows-bindgen" name = "windows-bindgen"
version = "0.44.0" version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "222204ecf46521382a4d88b4a1bbefca9f8855697b4ab7d20803901425e061a3" checksum = "1fe21a77bc54b7312dbd66f041605e098990c98be48cd52967b85b5e60e75ae6"
dependencies = [ dependencies = [
"windows-metadata", "windows-metadata",
"windows-tokens", "windows-tokens",
@@ -6250,9 +6278,9 @@ dependencies = [
[[package]] [[package]]
name = "windows-implement" name = "windows-implement"
version = "0.44.0" version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce87ca8e3417b02dc2a8a22769306658670ec92d78f1bd420d6310a67c245c6" checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -6261,9 +6289,9 @@ dependencies = [
[[package]] [[package]]
name = "windows-interface" name = "windows-interface"
version = "0.44.0" version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "853f69a591ecd4f810d29f17e902d40e349fb05b0b11fff63b08b826bfe39c7f" checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -6272,9 +6300,9 @@ dependencies = [
[[package]] [[package]]
name = "windows-metadata" name = "windows-metadata"
version = "0.44.0" version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee78911e3f4ce32c1ad9d3c7b0bd95389662ad8d8f1a3155688fed70bd96e2b6" checksum = "422ee0e5f0e2cc372bb6addbfff9a8add712155cd743df9c15f6ab000f31432d"
[[package]] [[package]]
name = "windows-sys" name = "windows-sys"
@@ -6291,7 +6319,7 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [ dependencies = [
"windows-targets 0.48.1", "windows-targets 0.48.2",
] ]
[[package]] [[package]]
@@ -6311,24 +6339,24 @@ dependencies = [
[[package]] [[package]]
name = "windows-targets" name = "windows-targets"
version = "0.48.1" version = "0.48.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8"
dependencies = [ dependencies = [
"windows_aarch64_gnullvm 0.48.0", "windows_aarch64_gnullvm 0.48.2",
"windows_aarch64_msvc 0.48.0", "windows_aarch64_msvc 0.48.2",
"windows_i686_gnu 0.48.0", "windows_i686_gnu 0.48.2",
"windows_i686_msvc 0.48.0", "windows_i686_msvc 0.48.2",
"windows_x86_64_gnu 0.48.0", "windows_x86_64_gnu 0.48.2",
"windows_x86_64_gnullvm 0.48.0", "windows_x86_64_gnullvm 0.48.2",
"windows_x86_64_msvc 0.48.0", "windows_x86_64_msvc 0.48.2",
] ]
[[package]] [[package]]
name = "windows-tokens" name = "windows-tokens"
version = "0.44.0" version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa4251900975a0d10841c5d4bde79c56681543367ef811f3fabb8d1803b0959b" checksum = "b34c9a3b28cb41db7385546f7f9a8179348dffc89923dde66857b1ba5312f6b4"
[[package]] [[package]]
name = "windows_aarch64_gnullvm" name = "windows_aarch64_gnullvm"
@@ -6338,9 +6366,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
[[package]] [[package]]
name = "windows_aarch64_gnullvm" name = "windows_aarch64_gnullvm"
version = "0.48.0" version = "0.48.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" checksum = "b10d0c968ba7f6166195e13d593af609ec2e3d24f916f081690695cf5eaffb2f"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
@@ -6362,9 +6390,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
version = "0.48.0" version = "0.48.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
@@ -6386,9 +6414,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
version = "0.48.0" version = "0.48.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
@@ -6410,9 +6438,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
version = "0.48.0" version = "0.48.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" checksum = "600956e2d840c194eedfc5d18f8242bc2e17c7775b6684488af3a9fff6fe3287"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
@@ -6434,9 +6462,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
version = "0.48.0" version = "0.48.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a"
[[package]] [[package]]
name = "windows_x86_64_gnullvm" name = "windows_x86_64_gnullvm"
@@ -6446,9 +6474,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
[[package]] [[package]]
name = "windows_x86_64_gnullvm" name = "windows_x86_64_gnullvm"
version = "0.48.0" version = "0.48.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" checksum = "8f1a05a1ece9a7a0d5a7ccf30ba2c33e3a61a30e042ffd247567d1de1d94120d"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
@@ -6470,9 +6498,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
version = "0.48.0" version = "0.48.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9"
[[package]] [[package]]
name = "winnow" name = "winnow"
@@ -6504,11 +6532,11 @@ dependencies = [
[[package]] [[package]]
name = "wry" name = "wry"
version = "0.28.3" version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d15f9f827d537cefe6d047be3930f5d89b238dfb85e08ba6a319153217635aa" checksum = "4c6289018fa3cbc051c13f4ae1a102d80c3f35a527456c75567eb2cad6989020"
dependencies = [ dependencies = [
"base64 0.13.1", "base64 0.21.2",
"block", "block",
"cocoa 0.24.1", "cocoa 0.24.1",
"core-graphics 0.22.3", "core-graphics 0.22.3",
@@ -6518,10 +6546,10 @@ dependencies = [
"gio", "gio",
"glib", "glib",
"gtk", "gtk",
"html5ever 0.25.2", "html5ever",
"http", "http",
"javascriptcore-rs", "javascriptcore-rs",
"kuchiki", "kuchikiki",
"libc", "libc",
"log", "log",
"objc", "objc",
@@ -6537,7 +6565,7 @@ dependencies = [
"webkit2gtk", "webkit2gtk",
"webkit2gtk-sys", "webkit2gtk-sys",
"webview2-com", "webview2-com",
"windows 0.44.0", "windows 0.48.0",
"windows-implement", "windows-implement",
] ]
@@ -6622,7 +6650,7 @@ checksum = "4034e1d05af98b51ad7214527730626f019682d797ba38b51689212118d8e650"
dependencies = [ dependencies = [
"log", "log",
"mac", "mac",
"markup5ever 0.11.0", "markup5ever",
] ]
[[package]] [[package]]

View File

@@ -11,15 +11,12 @@ rust-version = "1.71"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies] [build-dependencies]
tauri-build = { version = "2.0.0-alpha.6", features = [] } tauri-build = { version = "2.0.0-alpha.8", features = [] }
[dependencies] [dependencies]
serde_json = "1.0" serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
tauri = { version = "2.0.0-alpha.10", features = [ tauri = { version = "2.0.0-alpha.11", features = ["macos-private-api"] }
"macos-private-api",
"system-tray",
] }
tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-stronghold = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } tauri-plugin-stronghold = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
@@ -55,7 +52,7 @@ features = ["sqlite"]
default = ["custom-protocol"] default = ["custom-protocol"]
# this feature is used used for production builds where `devPath` points to the filesystem # this feature is used used for production builds where `devPath` points to the filesystem
# DO NOT remove this # DO NOT remove this
custom-protocol = ["tauri/custom-protocol"] custom-protocol = []
# Optimized for bundle size. If you want faster builds comment out/delete this section. # Optimized for bundle size. If you want faster builds comment out/delete this section.
[profile.release] [profile.release]

View File

@@ -89,10 +89,6 @@
"security": { "security": {
"csp": "upgrade-insecure-requests" "csp": "upgrade-insecure-requests"
}, },
"systemTray": {
"iconAsTemplate": true,
"iconPath": "icons/icon.png"
},
"windows": [ "windows": [
{ {
"width": 1080, "width": 1080,

View File

@@ -5,18 +5,18 @@ import { AuthImportScreen } from '@app/auth/import';
import { OnboardingScreen } from '@app/auth/onboarding'; import { OnboardingScreen } from '@app/auth/onboarding';
import { ErrorScreen } from '@app/error'; import { ErrorScreen } from '@app/error';
import { getActiveAccount } from '@libs/storage';
import { AppLayout } from '@shared/appLayout'; import { AppLayout } from '@shared/appLayout';
import { AuthLayout } from '@shared/authLayout'; import { AuthLayout } from '@shared/authLayout';
import { LoaderIcon } from '@shared/icons'; import { LoaderIcon } from '@shared/icons';
import { SettingsLayout } from '@shared/settingsLayout'; import { SettingsLayout } from '@shared/settingsLayout';
import { checkActiveAccount } from '@utils/checkActiveAccount';
import './index.css'; import './index.css';
const appLoader = async () => { async function Loader() {
try { try {
const account = await getActiveAccount(); const account = await checkActiveAccount();
const stronghold = sessionStorage.getItem('stronghold'); const stronghold = sessionStorage.getItem('stronghold');
const privkey = JSON.parse(stronghold).state.privkey || null; const privkey = JSON.parse(stronghold).state.privkey || null;
const onboarding = localStorage.getItem('onboarding'); const onboarding = localStorage.getItem('onboarding');
@@ -29,10 +29,6 @@ const appLoader = async () => {
if (!account) { if (!account) {
return redirect('/auth/welcome'); return redirect('/auth/welcome');
} else { } else {
if (account.privkey.length > 35) {
return redirect('/auth/migrate');
}
if (!privkey) { if (!privkey) {
return redirect('/auth/unlock'); return redirect('/auth/unlock');
} }
@@ -42,14 +38,14 @@ const appLoader = async () => {
} catch (e) { } catch (e) {
throw new Error('App failed to load'); throw new Error('App failed to load');
} }
}; }
const router = createBrowserRouter([ const router = createBrowserRouter([
{ {
path: '/', path: '/',
element: <AppLayout />, element: <AppLayout />,
errorElement: <ErrorScreen />, errorElement: <ErrorScreen />,
loader: appLoader, loader: Loader,
children: [ children: [
{ {
path: '', path: '',

View File

@@ -10,7 +10,6 @@ import { ArrowRightCircleIcon, LoaderIcon } from '@shared/icons';
import { useOnboarding } from '@stores/onboarding'; import { useOnboarding } from '@stores/onboarding';
import { useAccount } from '@utils/hooks/useAccount';
import { useNostr } from '@utils/hooks/useNostr'; import { useNostr } from '@utils/hooks/useNostr';
export function ImportStep3Screen() { export function ImportStep3Screen() {
@@ -21,7 +20,6 @@ export function ImportStep3Screen() {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { db } = useStorage(); const { db } = useStorage();
const { status, account } = useAccount();
const { fetchUserData } = useNostr(); const { fetchUserData } = useNostr();
const submit = async () => { const submit = async () => {
@@ -72,7 +70,7 @@ export function ImportStep3Screen() {
</div> </div>
) : ( ) : (
<div className="flex flex-col gap-3"> <div className="flex flex-col gap-3">
<User pubkey={account.pubkey} /> <User pubkey={db.account.pubkey} />
<button <button
type="button" type="button"
className="inline-flex h-11 w-full items-center justify-between gap-2 rounded-lg bg-fuchsia-500 px-6 font-medium leading-none text-white hover:bg-fuchsia-600 focus:outline-none" className="inline-flex h-11 w-full items-center justify-between gap-2 rounded-lg bg-fuchsia-500 px-6 font-medium leading-none text-white hover:bg-fuchsia-600 focus:outline-none"

View File

@@ -40,7 +40,6 @@ export function MigrateScreen() {
const [passwordInput, setPasswordInput] = useState('password'); const [passwordInput, setPasswordInput] = useState('password');
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { account } = useAccount();
const { db } = useStorage(); const { db } = useStorage();
// toggle private key // toggle private key
@@ -69,10 +68,10 @@ export function MigrateScreen() {
const stronghold = await Stronghold.load(`${dir}/lume.stronghold`, data.password); const stronghold = await Stronghold.load(`${dir}/lume.stronghold`, data.password);
if (!db.secureDB) db.secureDB = stronghold; if (!db.secureDB) db.secureDB = stronghold;
await db.secureSave(account.pubkey, account.privkey); await db.secureSave(db.account.pubkey, db.account.privkey);
// add privkey to state // add privkey to state
setPrivkey(account.privkey); setPrivkey(db.account.privkey);
// remove privkey in db // remove privkey in db
await removePrivkey(); await removePrivkey();
// clear cache // clear cache

View File

@@ -10,7 +10,6 @@ import { ArrowRightCircleIcon, CheckCircleIcon, LoaderIcon } from '@shared/icons
import { useOnboarding } from '@stores/onboarding'; import { useOnboarding } from '@stores/onboarding';
import { useAccount } from '@utils/hooks/useAccount';
import { useNostr } from '@utils/hooks/useNostr'; import { useNostr } from '@utils/hooks/useNostr';
import { arrayToNIP02 } from '@utils/transform'; import { arrayToNIP02 } from '@utils/transform';
@@ -21,7 +20,6 @@ export function OnboardStep1Screen() {
const { db } = useStorage(); const { db } = useStorage();
const { publish, fetchUserData } = useNostr(); const { publish, fetchUserData } = useNostr();
const { account } = useAccount();
const { status, data } = useQuery(['trending-profiles'], async () => { const { status, data } = useQuery(['trending-profiles'], async () => {
const res = await fetch('https://api.nostr.band/v0/trending/profiles'); const res = await fetch('https://api.nostr.band/v0/trending/profiles');
if (!res.ok) { if (!res.ok) {
@@ -45,7 +43,7 @@ export function OnboardStep1Screen() {
try { try {
setLoading(true); setLoading(true);
const tags = arrayToNIP02([...follows, account.pubkey]); const tags = arrayToNIP02([...follows, db.account.pubkey]);
const event = await publish({ content: '', kind: 3, tags: tags }); const event = await publish({ content: '', kind: 3, tags: tags });
await db.updateAccount('follows', follows); await db.updateAccount('follows', follows);

View File

@@ -12,7 +12,6 @@ import { ArrowRightCircleIcon, CheckCircleIcon, LoaderIcon } from '@shared/icons
import { FULL_RELAYS } from '@stores/constants'; import { FULL_RELAYS } from '@stores/constants';
import { useOnboarding } from '@stores/onboarding'; import { useOnboarding } from '@stores/onboarding';
import { useAccount } from '@utils/hooks/useAccount';
import { useNostr } from '@utils/hooks/useNostr'; import { useNostr } from '@utils/hooks/useNostr';
export function OnboardStep3Screen() { export function OnboardStep3Screen() {
@@ -22,15 +21,17 @@ export function OnboardStep3Screen() {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [relays, setRelays] = useState(new Set<string>()); const [relays, setRelays] = useState(new Set<string>());
const { db } = useStorage();
const { publish } = useNostr(); const { publish } = useNostr();
const { account } = useAccount(); const { db } = useStorage();
const { ndk } = useNDK(); const { ndk } = useNDK();
const { status, data } = useQuery( const { status, data } = useQuery(
['relays'], ['relays'],
async () => { async () => {
const tmp = new Map<string, string>(); const tmp = new Map<string, string>();
const events = await ndk.fetchEvents({ kinds: [10002], authors: account.follows }); const events = await ndk.fetchEvents({
kinds: [10002],
authors: db.account.follows,
});
if (events) { if (events) {
events.forEach((event) => { events.forEach((event) => {
@@ -43,7 +44,8 @@ export function OnboardStep3Screen() {
return tmp; return tmp;
}, },
{ {
enabled: account ? true : false, enabled: db.account ? true : false,
refetchOnWindowFocus: false,
} }
); );

View File

@@ -39,7 +39,6 @@ export function ResetScreen() {
const [passwordInput, setPasswordInput] = useState('password'); const [passwordInput, setPasswordInput] = useState('password');
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { account } = useAccount();
const { db } = useStorage(); const { db } = useStorage();
// toggle private key // toggle private key
@@ -69,7 +68,7 @@ export function ResetScreen() {
const tmpPubkey = getPublicKey(privkey); const tmpPubkey = getPublicKey(privkey);
if (tmpPubkey !== account.pubkey) { if (tmpPubkey !== db.account.pubkey) {
setLoading(false); setLoading(false);
setError('password', { setError('password', {
type: 'custom', type: 'custom',
@@ -88,10 +87,10 @@ export function ResetScreen() {
); );
if (!db.secureDB) db.secureDB = stronghold; if (!db.secureDB) db.secureDB = stronghold;
await db.secureSave(account.pubkey, account.privkey); await db.secureSave(db.account.pubkey, db.account.privkey);
// add privkey to state // add privkey to state
setPrivkey(account.privkey); setPrivkey(db.account.privkey);
// redirect to home // redirect to home
navigate('/auth/unlock', { replace: true }); navigate('/auth/unlock', { replace: true });
} }

View File

@@ -10,8 +10,6 @@ import { EyeOffIcon, EyeOnIcon, LoaderIcon } from '@shared/icons';
import { useStronghold } from '@stores/stronghold'; import { useStronghold } from '@stores/stronghold';
import { useAccount } from '@utils/hooks/useAccount';
type FormValues = { type FormValues = {
password: string; password: string;
}; };
@@ -37,7 +35,6 @@ export function UnlockScreen() {
const [showPassword, setShowPassword] = useState<boolean>(false); const [showPassword, setShowPassword] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(false); const [loading, setLoading] = useState<boolean>(false);
const { account } = useAccount();
const { db } = useStorage(); const { db } = useStorage();
const { const {
@@ -56,7 +53,7 @@ export function UnlockScreen() {
if (!db.secureDB) db.secureDB = stronghold; if (!db.secureDB) db.secureDB = stronghold;
const privkey = await db.secureLoad(account.pubkey); const privkey = await db.secureLoad(db.account.pubkey);
setPrivkey(privkey); setPrivkey(privkey);
// redirect to home // redirect to home

View File

@@ -6,24 +6,22 @@ import { NewMessageModal } from '@app/chats/components/modal';
import { ChatsListSelfItem } from '@app/chats/components/self'; import { ChatsListSelfItem } from '@app/chats/components/self';
import { UnknownsModal } from '@app/chats/components/unknowns'; import { UnknownsModal } from '@app/chats/components/unknowns';
import { useNDK } from '@libs/ndk/provider';
import { getChats } from '@libs/storage'; import { getChats } from '@libs/storage';
import { useStorage } from '@libs/storage/provider';
import { useAccount } from '@utils/hooks/useAccount';
import { Chats } from '@utils/types'; import { Chats } from '@utils/types';
export function ChatsList() { export function ChatsList() {
const { account } = useAccount(); const { db } = useStorage();
const { const { ndk } = useNDK();
status, const { status, data: chats } = useQuery(['chats'], async () => {
data: chats,
isFetching,
} = useQuery(['chats'], async () => {
return await getChats(); return await getChats();
}); });
const renderItem = useCallback( const renderItem = useCallback(
(item: Chats) => { (item: Chats) => {
if (account?.pubkey !== item.sender_pubkey) { if (db.account.pubkey !== item.sender_pubkey) {
return <ChatsListItem key={item.sender_pubkey} data={item} />; return <ChatsListItem key={item.sender_pubkey} data={item} />;
} }
}, },
@@ -47,21 +45,8 @@ export function ChatsList() {
return ( return (
<div className="flex flex-col"> <div className="flex flex-col">
{account ? ( <ChatsListSelfItem pubkey={db.account.pubkey} />
<ChatsListSelfItem data={account} />
) : (
<div className="inline-flex h-9 items-center gap-2.5 rounded-md px-2">
<div className="relative h-6 w-6 shrink-0 animate-pulse rounded bg-white/10" />
<div className="h-3 w-full animate-pulse rounded-sm bg-white/10" />
</div>
)}
{chats.follows.map((item) => renderItem(item))} {chats.follows.map((item) => renderItem(item))}
{isFetching && (
<div className="inline-flex h-9 items-center gap-2.5 rounded-md px-2">
<div className="relative h-6 w-6 shrink-0 animate-pulse rounded bg-white/10" />
<div className="h-3 w-full animate-pulse rounded-sm bg-white/10" />
</div>
)}
{chats.unknowns.length > 0 && <UnknownsModal data={chats.unknowns} />} {chats.unknowns.length > 0 && <UnknownsModal data={chats.unknowns} />}
<NewMessageModal /> <NewMessageModal />
</div> </div>

View File

@@ -4,15 +4,15 @@ import { useNavigate } from 'react-router-dom';
import { User } from '@app/auth/components/user'; import { User } from '@app/auth/components/user';
import { CancelIcon, LoaderIcon, PlusIcon } from '@shared/icons'; import { useStorage } from '@libs/storage/provider';
import { useAccount } from '@utils/hooks/useAccount'; import { CancelIcon, LoaderIcon, PlusIcon } from '@shared/icons';
export function NewMessageModal() { export function NewMessageModal() {
const navigate = useNavigate(); const navigate = useNavigate();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const { status, account } = useAccount(); const { db } = useStorage();
const openChat = (pubkey: string) => { const openChat = (pubkey: string) => {
setOpen(false); setOpen(false);
@@ -59,7 +59,7 @@ export function NewMessageModal() {
<LoaderIcon className="h-5 w-5 animate-spin text-white" /> <LoaderIcon className="h-5 w-5 animate-spin text-white" />
</div> </div>
) : ( ) : (
account?.follows?.map((follow) => ( db.account?.follows?.map((follow) => (
<div <div
key={follow} key={follow}
className="group flex items-center justify-between px-4 py-2 hover:bg-white/10" className="group flex items-center justify-between px-4 py-2 hover:bg-white/10"

View File

@@ -8,8 +8,8 @@ import { DEFAULT_AVATAR } from '@stores/constants';
import { useProfile } from '@utils/hooks/useProfile'; import { useProfile } from '@utils/hooks/useProfile';
import { displayNpub } from '@utils/shortenKey'; import { displayNpub } from '@utils/shortenKey';
export function ChatsListSelfItem({ data }: { data: { pubkey: string } }) { export function ChatsListSelfItem({ pubkey }: { pubkey: string }) {
const { status, user } = useProfile(data.pubkey); const { status, user } = useProfile(pubkey);
if (status === 'loading') { if (status === 'loading') {
return ( return (
@@ -22,7 +22,7 @@ export function ChatsListSelfItem({ data }: { data: { pubkey: string } }) {
return ( return (
<NavLink <NavLink
to={`/chats/${data.pubkey}`} to={`/chats/${pubkey}`}
preventScrollReset={true} preventScrollReset={true}
className={({ isActive }) => className={({ isActive }) =>
twMerge( twMerge(
@@ -34,12 +34,12 @@ export function ChatsListSelfItem({ data }: { data: { pubkey: string } }) {
<Image <Image
src={user?.picture || user?.image} src={user?.picture || user?.image}
fallback={DEFAULT_AVATAR} fallback={DEFAULT_AVATAR}
alt={data.pubkey} alt={pubkey}
className="h-6 w-6 shrink-0 rounded bg-white object-cover" className="h-6 w-6 shrink-0 rounded bg-white object-cover"
/> />
<div className="inline-flex items-baseline gap-1"> <div className="inline-flex items-baseline gap-1">
<h5 className="max-w-[10rem] truncate"> <h5 className="max-w-[10rem] truncate">
{user?.nip05 || user?.name || displayNpub(data.pubkey, 16)} {user?.nip05 || user?.name || displayNpub(pubkey, 16)}
</h5> </h5>
<span className="text-white/50">(you)</span> <span className="text-white/50">(you)</span>
</div> </div>

View File

@@ -10,10 +10,10 @@ import { ChatSidebar } from '@app/chats/components/sidebar';
import { useNDK } from '@libs/ndk/provider'; import { useNDK } from '@libs/ndk/provider';
import { createChat, getChatMessages } from '@libs/storage'; import { createChat, getChatMessages } from '@libs/storage';
import { useStorage } from '@libs/storage/provider';
import { useStronghold } from '@stores/stronghold'; import { useStronghold } from '@stores/stronghold';
import { useAccount } from '@utils/hooks/useAccount';
import { Chats } from '@utils/types'; import { Chats } from '@utils/types';
export function ChatScreen() { export function ChatScreen() {
@@ -21,17 +21,11 @@ export function ChatScreen() {
const virtuosoRef = useRef(null); const virtuosoRef = useRef(null);
const { ndk } = useNDK(); const { ndk } = useNDK();
const { db } = useStorage();
const { pubkey } = useParams(); const { pubkey } = useParams();
const { account } = useAccount(); const { status, data } = useQuery(['chat', pubkey], async () => {
const { status, data } = useQuery( return await getChatMessages(db.account.pubkey, pubkey);
['chat', pubkey], });
async () => {
return await getChatMessages(account.pubkey, pubkey);
},
{
enabled: account ? true : false,
}
);
const userPrivkey = useStronghold((state) => state.privkey); const userPrivkey = useStronghold((state) => state.privkey);
@@ -40,7 +34,7 @@ export function ChatScreen() {
return ( return (
<ChatMessageItem <ChatMessageItem
data={data[index]} data={data[index]}
userPubkey={account.pubkey} userPubkey={db.account.pubkey}
userPrivkey={userPrivkey} userPrivkey={userPrivkey}
/> />
); );
@@ -75,7 +69,7 @@ export function ChatScreen() {
const sub: NDKSubscription = ndk.subscribe( const sub: NDKSubscription = ndk.subscribe(
{ {
kinds: [4], kinds: [4],
authors: [account.pubkey], authors: [db.account.pubkey],
'#p': [pubkey], '#p': [pubkey],
since: Math.floor(Date.now() / 1000), since: Math.floor(Date.now() / 1000),
}, },
@@ -129,7 +123,7 @@ export function ChatScreen() {
<div className="z-50 shrink-0 rounded-b-xl border-t border-white/5 bg-white/10 p-3 px-5"> <div className="z-50 shrink-0 rounded-b-xl border-t border-white/5 bg-white/10 p-3 px-5">
<ChatMessageForm <ChatMessageForm
receiverPubkey={pubkey} receiverPubkey={pubkey}
userPubkey={account.pubkey} userPubkey={db.account.pubkey}
userPrivkey={userPrivkey} userPrivkey={userPrivkey}
/> />
</div> </div>

View File

@@ -1,22 +1,80 @@
import { useRouteError } from 'react-router-dom'; import { useEffect, useState } from 'react';
import { useLocation, useRouteError } from 'react-router-dom';
interface IRouteError { interface IRouteError {
statusText: string; statusText: string;
message: string; message: string;
} }
interface IDebugInfo {
os: null | string;
version: null | string;
}
export function ErrorScreen() { export function ErrorScreen() {
const error = useRouteError() as IRouteError; const error = useRouteError() as IRouteError;
const location = useLocation();
const [debugInfo, setDebugInfo] = useState<IDebugInfo>({ os: null, version: null });
useEffect(() => {
async function getInformation() {
const { platform, version } = await import('@tauri-apps/plugin-os');
const { getVersion } = await import('@tauri-apps/plugin-app');
const platformName = await platform();
const osVersion = await version();
const appVersion = await getVersion();
setDebugInfo({ os: platformName + ' ' + osVersion, version: appVersion });
}
getInformation();
}, []);
return ( return (
<div className="flex h-full w-full items-center justify-center"> <div className="flex h-full w-full items-center justify-center bg-black/90">
<div> <div className="flex flex-col gap-4">
<h1>Oops!</h1> <div className="flex flex-col">
<p>Sorry, an unexpected error has occurred.</p> <h1 className="mb-1 text-2xl font-semibold text-white">
<p> Sorry, an unexpected error has occurred.
<i>{error.statusText || error.message}</i> </h1>
<div className="mt-4 inline-flex h-16 items-center justify-center rounded-xl border border-dashed border-red-400 bg-red-200/10 px-5">
<p className="text-sm font-medium text-red-400">
{error.statusText || error.message}
</p> </p>
</div> </div>
<div className="mt-4">
<p className="font-medium text-white/50">
Current location: {location.pathname}
</p>
<p className="font-medium text-white/50">App version: {debugInfo.version}</p>
<p className="font-medium text-white/50">Platform: {debugInfo.os}</p>
</div>
</div>
<div className="flex flex-col gap-2">
<a
href="https://github.com/luminous-devs/lume/issues/new"
target="_blank"
rel="noreferrer"
className="inline-flex h-11 w-full items-center justify-center rounded-lg bg-white/10 text-sm font-medium text-white hover:bg-white/20"
>
Click here to report the issue on GitHub
</a>
<button
type="button"
className="inline-flex h-11 w-full items-center justify-center rounded-lg bg-white/10 text-sm font-medium text-white hover:bg-white/20"
>
Reload app
</button>
<button
type="button"
className="inline-flex h-11 w-full items-center justify-center rounded-lg bg-white/10 text-sm font-medium text-white hover:bg-white/20"
>
Reset app
</button>
</div>
</div>
</div> </div>
); );
} }

View File

@@ -1,5 +1,7 @@
import { useParams } from 'react-router-dom'; import { useParams } from 'react-router-dom';
import { useStorage } from '@libs/storage/provider';
import { import {
NoteActions, NoteActions,
NoteContent, NoteContent,
@@ -10,12 +12,11 @@ import {
import { RepliesList } from '@shared/notes/replies/list'; import { RepliesList } from '@shared/notes/replies/list';
import { NoteSkeleton } from '@shared/notes/skeleton'; import { NoteSkeleton } from '@shared/notes/skeleton';
import { useAccount } from '@utils/hooks/useAccount';
import { useEvent } from '@utils/hooks/useEvent'; import { useEvent } from '@utils/hooks/useEvent';
export function EventScreen() { export function EventScreen() {
const { id } = useParams(); const { id } = useParams();
const { account } = useAccount(); const { db } = useStorage();
const { status, data } = useEvent(id); const { status, data } = useEvent(id);
return ( return (
@@ -42,7 +43,7 @@ export function EventScreen() {
</div> </div>
)} )}
<div className="px-3"> <div className="px-3">
<NoteReplyForm id={id} pubkey={account.pubkey} /> <NoteReplyForm id={id} pubkey={db.account.pubkey} />
<RepliesList id={id} /> <RepliesList id={id} />
</div> </div>
</div> </div>

View File

@@ -1,36 +1,34 @@
import { useInfiniteQuery } from '@tanstack/react-query'; import { useInfiniteQuery } from '@tanstack/react-query';
import { useVirtualizer } from '@tanstack/react-virtual'; import { useVirtualizer } from '@tanstack/react-virtual';
import { useCallback, useEffect, useRef } from 'react'; import { NostrEvent } from 'nostr-fetch';
import { useCallback, useEffect, useMemo, useRef } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { useNewsfeed } from '@app/space/hooks/useNewsfeed';
import { getNotes } from '@libs/storage';
import { NoteKind_1, NoteKind_1063, NoteThread, Repost } from '@shared/notes'; import { NoteKind_1, NoteKind_1063, NoteThread, Repost } from '@shared/notes';
import { NoteKindUnsupport } from '@shared/notes/kinds/unsupport'; import { NoteKindUnsupport } from '@shared/notes/kinds/unsupport';
import { NoteSkeleton } from '@shared/notes/skeleton'; import { NoteSkeleton } from '@shared/notes/skeleton';
import { TitleBar } from '@shared/titleBar'; import { TitleBar } from '@shared/titleBar';
import { useNostr } from '@utils/hooks/useNostr';
import { LumeEvent } from '@utils/types'; import { LumeEvent } from '@utils/types';
const ITEM_PER_PAGE = 10;
export function NetworkBlock() { export function NetworkBlock() {
// subscribe for live update const { fetchNotes } = useNostr();
// useNewsfeed(); const { status, data, hasNextPage, isFetchingNextPage, fetchNextPage } =
const { status, data, fetchNextPage, hasNextPage, isFetchingNextPage } =
useInfiniteQuery({ useInfiniteQuery({
queryKey: ['network-widget'], queryKey: ['network-widget'],
queryFn: async ({ pageParam = 0 }) => { queryFn: async ({ pageParam = 24 }) => {
return await getNotes(ITEM_PER_PAGE, pageParam); return await fetchNotes(pageParam);
}, },
getNextPageParam: (lastPage) => lastPage.nextCursor, getNextPageParam: (lastPage) => lastPage.nextCursor,
}); });
const notes = data ? data.pages.flatMap((d: { data: LumeEvent[] }) => d.data) : [];
const parentRef = useRef(); const parentRef = useRef();
const notes = useMemo(
// @ts-expect-error, todo
() => (data ? data.pages.flatMap((d: { data: NostrEvent[] }) => d.data) : []),
[data]
);
const rowVirtualizer = useVirtualizer({ const rowVirtualizer = useVirtualizer({
count: hasNextPage ? notes.length + 1 : notes.length, count: hasNextPage ? notes.length + 1 : notes.length,
@@ -140,7 +138,7 @@ export function NetworkBlock() {
<div className="rounded-xl bg-white/10 px-3 py-6"> <div className="rounded-xl bg-white/10 px-3 py-6">
<div className="flex flex-col items-center gap-4"> <div className="flex flex-col items-center gap-4">
<p className="text-center text-sm text-white"> <p className="text-center text-sm text-white">
You not have any posts to see yet You not have any postrs to see yet
<br /> <br />
Follow more people to have more fun. Follow more people to have more fun.
</p> </p>
@@ -148,7 +146,7 @@ export function NetworkBlock() {
to="/trending" to="/trending"
className="inline-flex w-max rounded bg-fuchsia-500 px-2.5 py-1.5 text-sm hover:bg-fuchsia-600" className="inline-flex w-max rounded bg-fuchsia-500 px-2.5 py-1.5 text-sm hover:bg-fuchsia-600"
> >
Trending Trending users
</Link> </Link>
</div> </div>
</div> </div>

View File

@@ -6,13 +6,11 @@ import { useStorage } from '@libs/storage/provider';
import { LoaderIcon } from '@shared/icons'; import { LoaderIcon } from '@shared/icons';
import { useAccount } from '@utils/hooks/useAccount';
import { useNostr } from '@utils/hooks/useNostr'; import { useNostr } from '@utils/hooks/useNostr';
export function SplashScreen() { export function SplashScreen() {
const { db } = useStorage(); const { db } = useStorage();
const { ndk, relayUrls } = useNDK(); const { ndk, relayUrls } = useNDK();
const { status, account } = useAccount();
const { fetchUserData } = useNostr(); const { fetchUserData } = useNostr();
const [isLoading, setIsLoading] = useState<boolean>(true); const [isLoading, setIsLoading] = useState<boolean>(true);
@@ -46,15 +44,15 @@ export function SplashScreen() {
}; };
useEffect(() => { useEffect(() => {
if (status === 'success' && !account) { if (!db.account) {
invoke('close_splashscreen'); invoke('close_splashscreen');
} }
if (ndk && account) { if (ndk && db.account) {
console.log('prefetching...'); console.log('prefetching...');
prefetch(); prefetch();
} }
}, [ndk, account]); }, [ndk, db.account]);
return ( return (
<div className="relative flex h-screen w-screen items-center justify-center bg-black"> <div className="relative flex h-screen w-screen items-center justify-center bg-black">

View File

@@ -1,5 +1,4 @@
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { fetch } from '@tauri-apps/plugin-http';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { FollowIcon, LoaderIcon, UnfollowIcon } from '@shared/icons'; import { FollowIcon, LoaderIcon, UnfollowIcon } from '@shared/icons';

View File

@@ -1,5 +1,4 @@
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { fetch } from '@tauri-apps/plugin-http';
import { NoteKind_1 } from '@shared/notes'; import { NoteKind_1 } from '@shared/notes';
import { NoteSkeleton } from '@shared/notes/skeleton'; import { NoteSkeleton } from '@shared/notes/skeleton';

View File

@@ -1,5 +1,4 @@
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { fetch } from '@tauri-apps/plugin-http';
import { Profile } from '@app/trending/components/profile'; import { Profile } from '@app/trending/components/profile';

View File

@@ -1,6 +1,5 @@
// inspire by: https://github.com/nostr-dev-kit/ndk-react/ // inspire by: https://github.com/nostr-dev-kit/ndk-react/
import NDK from '@nostr-dev-kit/ndk'; import NDK from '@nostr-dev-kit/ndk';
import { fetch } from '@tauri-apps/plugin-http';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import TauriAdapter from '@libs/ndk/cache'; import TauriAdapter from '@libs/ndk/cache';
@@ -31,14 +30,21 @@ export const NDKInstance = () => {
} }
try { try {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort('timeout'), 5000);
const res = await fetch(url, { const res = await fetch(url, {
headers: { Accept: 'application/nostr+json' }, headers: { Accept: 'application/nostr+json' },
signal: controller.signal,
}); });
if (res.ok) { if (res.ok) {
const data = await res.json(); const data = await res.json();
console.log('relay information: ', data); console.log('relay information: ', data);
verifiedRelays.push(relay); verifiedRelays.push(relay);
clearTimeout(timeoutId);
} else {
console.log('relay not working: ', res);
} }
} catch (e) { } catch (e) {
console.log('fetch error', e); console.log('fetch error', e);

View File

@@ -36,12 +36,6 @@ export async function getActiveAccount() {
'SELECT * FROM accounts WHERE is_active = 1;' 'SELECT * FROM accounts WHERE is_active = 1;'
); );
if (result.length > 0) { if (result.length > 0) {
result[0]['follows'] = result[0].follows
? JSON.parse(result[0].follows as unknown as string)
: null;
result[0]['network'] = result[0].network
? JSON.parse(result[0].network as unknown as string)
: null;
return result[0]; return result[0];
} else { } else {
return null; return null;

View File

@@ -7,10 +7,12 @@ import { Account, Relays, Widget } from '@utils/types';
export class LumeStorage { export class LumeStorage {
public db: Database; public db: Database;
public secureDB: Stronghold; public secureDB: Stronghold;
public account: Account | null = null;
constructor(sqlite: Database, stronghold?: Stronghold) { constructor(sqlite: Database, stronghold?: Stronghold) {
this.db = sqlite; this.db = sqlite;
this.secureDB = stronghold ?? undefined; this.secureDB = stronghold ?? undefined;
this.account = null;
} }
private async getSecureClient() { private async getSecureClient() {
@@ -45,19 +47,24 @@ export class LumeStorage {
} }
public async getActiveAccount() { public async getActiveAccount() {
const account: Account = await this.db.select( const results: Array<Account> = await this.db.select(
'SELECT * FROM accounts WHERE is_active = 1;' 'SELECT * FROM accounts WHERE is_active = "1" ORDER BY id DESC LIMIT 1;'
)?.[0]; );
if (account) {
if (results.length > 0) {
const account = results[0];
if (typeof account.follows === 'string') if (typeof account.follows === 'string')
account.follows = JSON.parse(account.follows); account.follows = JSON.parse(account.follows);
if (typeof account.network === 'string') if (typeof account.network === 'string')
account.network = JSON.parse(account.network); account.network = JSON.parse(account.network);
this.account = account;
return account; return account;
} else { } else {
throw new Error('Account not found'); console.log('no active account, please create new account');
return null;
} }
} }
@@ -75,27 +82,30 @@ export class LumeStorage {
} }
public async updateAccount(column: string, value: string | string[]) { public async updateAccount(column: string, value: string | string[]) {
const insert = await this.db.execute(
`UPDATE accounts SET ${column} = $1 WHERE id = $2;`,
[value, this.account.id]
);
if (insert) {
const account = await this.getActiveAccount(); const account = await this.getActiveAccount();
return await this.db.execute(`UPDATE accounts SET ${column} = $1 WHERE id = $2;`, [ return account;
value, }
account.id,
]);
} }
public async getWidgets() { public async getWidgets() {
const account = await this.getActiveAccount();
const result: Array<Widget> = await this.db.select( const result: Array<Widget> = await this.db.select(
`SELECT * FROM widgets WHERE account_id = "${account.id}" ORDER BY created_at DESC;` `SELECT * FROM widgets WHERE account_id = "${this.account.id}" ORDER BY created_at DESC;`
); );
return result; return result;
} }
public async createWidget(kind: number, title: string, content: string | string[]) { public async createWidget(kind: number, title: string, content: string | string[]) {
const account = await this.getActiveAccount();
const insert = await this.db.execute( const insert = await this.db.execute(
'INSERT OR IGNORE INTO widgets (account_id, kind, title, content) VALUES ($1, $2, $3, $4);', 'INSERT OR IGNORE INTO widgets (account_id, kind, title, content) VALUES ($1, $2, $3, $4);',
[account.id, kind, title, content] [this.account.id, kind, title, content]
); );
if (insert) { if (insert) {
const widget: Widget = await this.db.select( const widget: Widget = await this.db.select(
'SELECT * FROM widgets ORDER BY id DESC LIMIT 1;' 'SELECT * FROM widgets ORDER BY id DESC LIMIT 1;'
@@ -129,7 +139,7 @@ export class LumeStorage {
[cacheKey] [cacheKey]
)?.[0]; )?.[0];
if (!event) { if (!event) {
console.error('failed to get event by cache_key: ', cacheKey); // console.error('failed to get event by cache_key: ', cacheKey);
return null; return null;
} }
return event; return event;
@@ -141,16 +151,15 @@ export class LumeStorage {
[id] [id]
)?.[0]; )?.[0];
if (!event) { if (!event) {
console.error('failed to get event by id: ', id); // console.error('failed to get event by id: ', id);
return null; return null;
} }
return event; return event;
} }
public async getExplicitRelayUrls() { public async getExplicitRelayUrls() {
const account = await this.getActiveAccount();
const result: Relays[] = await this.db.select( const result: Relays[] = await this.db.select(
`SELECT * FROM relays WHERE account_id = "${account.id}";` `SELECT * FROM relays WHERE account_id = "${this.account.id}";`
); );
if (result.length > 0) return result.map((el) => el.relay); if (result.length > 0) return result.map((el) => el.relay);
@@ -158,10 +167,9 @@ export class LumeStorage {
} }
public async createRelay(relay: string, purpose?: string) { public async createRelay(relay: string, purpose?: string) {
const account = await this.getActiveAccount();
return await this.db.execute( return await this.db.execute(
'INSERT OR IGNORE INTO relays (account_id, relay, purpose) VALUES ($1, $2, $3);', 'INSERT OR IGNORE INTO relays (account_id, relay, purpose) VALUES ($1, $2, $3);',
[account.id, relay, purpose || ''] [this.account.id, relay, purpose || '']
); );
} }

View File

@@ -17,6 +17,8 @@ const StorageProvider = ({ children }: PropsWithChildren<object>) => {
async function initLumeStorage() { async function initLumeStorage() {
const sqlite = await Database.load('sqlite:lume.db'); const sqlite = await Database.load('sqlite:lume.db');
const lumeStorage = new LumeStorage(sqlite); const lumeStorage = new LumeStorage(sqlite);
if (!lumeStorage.account) await lumeStorage.getActiveAccount();
setDB(lumeStorage); setDB(lumeStorage);
} }

View File

@@ -1,7 +1,6 @@
import { Dialog, Transition } from '@headlessui/react'; import { Dialog, Transition } from '@headlessui/react';
import { NDKEvent } from '@nostr-dev-kit/ndk'; import { NDKEvent } from '@nostr-dev-kit/ndk';
import { useQueryClient } from '@tanstack/react-query'; import { useQueryClient } from '@tanstack/react-query';
import { fetch } from '@tauri-apps/plugin-http';
import { Fragment, useEffect, useState } from 'react'; import { Fragment, useEffect, useState } from 'react';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';

View File

@@ -1,29 +1,20 @@
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { useStorage } from '@libs/storage/provider';
import { ActiveAccount } from '@shared/accounts/active'; import { ActiveAccount } from '@shared/accounts/active';
import { SettingsIcon } from '@shared/icons'; import { SettingsIcon } from '@shared/icons';
import { Logout } from '@shared/logout'; import { Logout } from '@shared/logout';
import { NotificationModal } from '@shared/notification/modal'; import { NotificationModal } from '@shared/notification/modal';
import { useAccount } from '@utils/hooks/useAccount';
export function LumeBar() { export function LumeBar() {
const { status, account } = useAccount(); const { db } = useStorage();
return ( return (
<div className="rounded-xl bg-white/10 p-2 backdrop-blur-xl"> <div className="rounded-xl bg-white/10 p-2 backdrop-blur-xl">
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
{status === 'loading' ? ( <ActiveAccount data={db.account} />
<> <NotificationModal pubkey={db.account.pubkey} />
<div className="group relative flex h-9 w-9 shrink animate-pulse items-center justify-center rounded-md bg-zinc-900" />
<div className="group relative flex h-9 w-9 shrink animate-pulse items-center justify-center rounded-md bg-zinc-900" />
</>
) : (
<>
<ActiveAccount data={account} />
<NotificationModal pubkey={account.pubkey} />
</>
)}
<Link <Link
to="/settings/general" to="/settings/general"
className="inline-flex h-9 w-9 transform items-center justify-center rounded-md bg-white/20 active:translate-y-1" className="inline-flex h-9 w-9 transform items-center justify-center rounded-md bg-white/20 active:translate-y-1"

View File

@@ -97,28 +97,6 @@ export function Navigation() {
</Collapsible.Content> </Collapsible.Content>
</div> </div>
</Collapsible.Root> </Collapsible.Root>
<Collapsible.Root open={chats} onOpenChange={setChats}>
<div className="flex flex-col gap-1 px-2">
<Collapsible.Trigger asChild>
<button className="flex items-center gap-1">
<div
className={twMerge(
'inline-flex h-5 w-5 transform items-center justify-center transition-transform duration-150 ease-in-out',
open ? '' : 'rotate-180'
)}
>
<NavArrowDownIcon className="h-3 w-3 text-white/50" />
</div>
<h3 className="text-[11px] font-bold uppercase tracking-widest text-white/50">
Chats
</h3>
</button>
</Collapsible.Trigger>
<Collapsible.Content>
<ChatsList />
</Collapsible.Content>
</div>
</Collapsible.Root>
{/* Channels {/* Channels
<Disclosure defaultOpen={true}> <Disclosure defaultOpen={true}>
{({ open }) => ( {({ open }) => (

View File

@@ -10,8 +10,6 @@ import { NoteZap } from '@shared/notes/actions/zap';
import { BLOCK_KINDS } from '@stores/constants'; import { BLOCK_KINDS } from '@stores/constants';
import { useWidgets } from '@stores/widgets'; import { useWidgets } from '@stores/widgets';
import { useAccount } from '@utils/hooks/useAccount';
export function NoteActions({ export function NoteActions({
id, id,
pubkey, pubkey,
@@ -23,7 +21,6 @@ export function NoteActions({
noOpenThread?: boolean; noOpenThread?: boolean;
root?: string; root?: string;
}) { }) {
const { account } = useAccount();
const setWidget = useWidgets((state) => state.setWidget); const setWidget = useWidgets((state) => state.setWidget);
return ( return (
@@ -33,7 +30,7 @@ export function NoteActions({
<NoteReply id={id} pubkey={pubkey} root={root} /> <NoteReply id={id} pubkey={pubkey} root={root} />
<NoteReaction id={id} pubkey={pubkey} /> <NoteReaction id={id} pubkey={pubkey} />
<NoteRepost id={id} pubkey={pubkey} /> <NoteRepost id={id} pubkey={pubkey} />
{(account?.lud06 || account?.lud16) && <NoteZap id={id} />} <NoteZap id={id} />
</div> </div>
{!noOpenThread && ( {!noOpenThread && (
<> <>

View File

@@ -67,15 +67,12 @@ export function NoteMetadata({ id }: { id: string }) {
if (status === 'loading') { if (status === 'loading') {
return ( return (
<div>
<div className="absolute left-[18px] top-14 h-[calc(100%-6.4rem)] w-0.5 bg-gradient-to-t from-white/20 to-white/10" />
<div className="relative z-10 flex items-center gap-3 pb-3"> <div className="relative z-10 flex items-center gap-3 pb-3">
<div className="mt-2 h-6 w-11 shrink-0"></div> <div className="mt-2 h-6 w-11 shrink-0"></div>
<div className="mt-2 inline-flex h-6"> <div className="mt-2 inline-flex h-6">
<LoaderIcon className="h-4 w-4 animate-spin text-white" /> <LoaderIcon className="h-4 w-4 animate-spin text-white" />
</div> </div>
</div> </div>
</div>
); );
} }

View File

@@ -30,7 +30,7 @@ export const useWidgets = create<WidgetState>()(
}, },
}), }),
{ {
name: 'blocks', name: 'widgets',
storage: createJSONStorage(() => localStorage), storage: createJSONStorage(() => localStorage),
} }
) )

View File

@@ -0,0 +1,33 @@
import Database from '@tauri-apps/plugin-sql';
import { Account } from '@utils/types';
let db: null | Database = null;
async function connect(): Promise<Database> {
if (db) {
return db;
}
try {
db = await Database.load('sqlite:lume.db');
} catch (e) {
throw new Error('Failed to connect to database, error: ', e);
}
return db;
}
export async function checkActiveAccount() {
const tempDB = await connect();
const result: Array<Account> = await db.select(
'SELECT * FROM accounts WHERE is_active = 1;'
);
// close temp db
tempDB.close();
if (result.length > 0) {
return true;
} else {
return false;
}
}

View File

@@ -1,14 +1,15 @@
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { useNDK } from '@libs/ndk/provider'; import { useNDK } from '@libs/ndk/provider';
import { getActiveAccount } from '@libs/storage'; import { useStorage } from '@libs/storage/provider';
export function useAccount() { export function useAccount() {
const { db } = useStorage();
const { ndk } = useNDK(); const { ndk } = useNDK();
const { status, data: account } = useQuery( const { status, data: account } = useQuery(
['account'], ['account'],
async () => { async () => {
const account = await getActiveAccount(); const account = await db.getActiveAccount();
console.log('account: ', account); console.log('account: ', account);
if (account?.pubkey) { if (account?.pubkey) {
const user = ndk.getUser({ hexpubkey: account?.pubkey }); const user = ndk.getUser({ hexpubkey: account?.pubkey });

View File

@@ -7,7 +7,6 @@ import {
NDKUser, NDKUser,
} from '@nostr-dev-kit/ndk'; } from '@nostr-dev-kit/ndk';
import { ndkAdapter } from '@nostr-fetch/adapter-ndk'; import { ndkAdapter } from '@nostr-fetch/adapter-ndk';
import { useQueryClient } from '@tanstack/react-query';
import destr from 'destr'; import destr from 'destr';
import { LRUCache } from 'lru-cache'; import { LRUCache } from 'lru-cache';
import { NostrFetcher } from 'nostr-fetch'; import { NostrFetcher } from 'nostr-fetch';
@@ -19,14 +18,12 @@ import { useStorage } from '@libs/storage/provider';
import { useStronghold } from '@stores/stronghold'; import { useStronghold } from '@stores/stronghold';
import { useAccount } from '@utils/hooks/useAccount'; import { nHoursAgo } from '@utils/date';
export function useNostr() { export function useNostr() {
const { ndk, relayUrls } = useNDK(); const { ndk, relayUrls } = useNDK();
const { account } = useAccount();
const { db } = useStorage(); const { db } = useStorage();
const queryClient = useQueryClient();
const privkey = useStronghold((state) => state.privkey); const privkey = useStronghold((state) => state.privkey);
const fetcher = useMemo(() => NostrFetcher.withCustomPool(ndkAdapter(ndk)), [ndk]); const fetcher = useMemo(() => NostrFetcher.withCustomPool(ndkAdapter(ndk)), [ndk]);
const subManager = useMemo( const subManager = useMemo(
@@ -58,7 +55,7 @@ export function useNostr() {
// fetch user's follows // fetch user's follows
if (!preFollows) { if (!preFollows) {
const user = ndk.getUser({ hexpubkey: account.pubkey }); const user = ndk.getUser({ hexpubkey: db.account.pubkey });
const list = await user.follows(); const list = await user.follows();
list.forEach((item: NDKUser) => { list.forEach((item: NDKUser) => {
follows.add(nip19.decode(item.npub).data as string); follows.add(nip19.decode(item.npub).data as string);
@@ -78,8 +75,6 @@ export function useNostr() {
await db.updateAccount('follows', [...follows]); await db.updateAccount('follows', [...follows]);
await db.updateAccount('network', [...new Set([...follows, ...network])]); await db.updateAccount('network', [...new Set([...follows, ...network])]);
queryClient.invalidateQueries(['account']);
return { status: 'ok' }; return { status: 'ok' };
} catch (e) { } catch (e) {
return { status: 'failed', message: e }; return { status: 'failed', message: e };
@@ -90,19 +85,23 @@ export function useNostr() {
try { try {
if (!ndk) return { status: 'failed', message: 'NDK instance not found' }; if (!ndk) return { status: 'failed', message: 'NDK instance not found' };
const events = await fetcher.fetchAllEvents( const until = since === 24 ? Math.floor(Date.now() / 1000) : nHoursAgo(since / 2);
relayUrls,
{
kinds: [1],
authors: account.network ?? account.follows,
},
{ since: since }
);
return { status: 'ok', notes: events }; console.log('fetch events since: ', since);
console.log('fetch events until: ', until);
/*
const events = await ndk.fetchEvents({
kinds: [1],
authors: db.account.network ?? db.account.follows,
since: since,
until: until,
});
*/
return { status: 'ok', data: [], nextCursor: since * 2 };
} catch (e) { } catch (e) {
console.error('failed get notes, error: ', e); console.error('failed get notes, error: ', e);
return { status: 'failed', message: e }; return { status: 'failed', data: [], message: e };
} }
}; };
@@ -123,7 +122,7 @@ export function useNostr() {
event.content = content; event.content = content;
event.kind = kind; event.kind = kind;
event.created_at = Math.floor(Date.now() / 1000); event.created_at = Math.floor(Date.now() / 1000);
event.pubkey = account.pubkey; event.pubkey = db.account.pubkey;
event.tags = tags; event.tags = tags;
await event.sign(signer); await event.sign(signer);