From f0a3390d10787b4956c5b5883c43ab88556400f7 Mon Sep 17 00:00:00 2001 From: shan <47271333+shanimal08@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:17:19 +0200 Subject: [PATCH 1/7] feat(ui): orphan chain info tooltip (#1213) Description --- - added tooltip for steps to try if you've landed up on an orphan chain - adjusted dialog styling for the loader when importing a new wallet form seed words Motivation and Context --- resolves: - https://github.com/tari-project/universe/issues/1193 - https://github.com/tari-project/universe/issues/1189 How Has This Been Tested? --- - locally: https://github.com/user-attachments/assets/fbeee140-fda3-4467-8282-cf824d1e3514 https://github.com/user-attachments/assets/bc944f27-3ce2-4b36-a6e2-e016c36ed8df --- Screenshot 2024-12-09 at 14 21 08 Screenshot 2024-12-09 at 14 32 45 Screenshot 2024-12-09 at 14 32 49 --- public/locales/af/mining-view.json | 9 +++ public/locales/af/settings.json | 6 ++ public/locales/cn/mining-view.json | 9 +++ public/locales/cn/settings.json | 6 ++ public/locales/de/mining-view.json | 9 +++ public/locales/de/settings.json | 6 ++ public/locales/en/mining-view.json | 9 +++ public/locales/en/settings.json | 15 ++-- public/locales/fr/mining-view.json | 9 +++ public/locales/fr/settings.json | 6 ++ public/locales/hi/mining-view.json | 9 +++ public/locales/hi/settings.json | 6 ++ public/locales/id/mining-view.json | 9 +++ public/locales/id/settings.json | 6 ++ public/locales/ja/mining-view.json | 9 +++ public/locales/ja/settings.json | 6 ++ public/locales/ko/mining-view.json | 9 +++ public/locales/ko/settings.json | 6 ++ public/locales/pl/mining-view.json | 9 +++ public/locales/pl/settings.json | 6 ++ public/locales/ru/mining-view.json | 9 +++ public/locales/ru/settings.json | 6 ++ public/locales/tr/mining-view.json | 9 +++ public/locales/tr/settings.json | 6 ++ .../AdminUI/groups/OtherUIGroup.tsx | 6 ++ src/components/elements/List.tsx | 31 ++++++++ .../wallet/SeedWordsMarkup/SeedWordsEdit.tsx | 25 ++++-- src/containers/main/SideBar/SideBar.tsx | 2 +- .../components/LostConnectionAlert.tsx | 8 +- .../SideBar/components/OrphanChainAlert.tsx | 36 --------- .../OrphanChainAlert.styles.ts | 56 +++++++++++++ .../OrphanChainAlert/OrphanChainAlert.tsx | 79 +++++++++++++++++++ src/containers/main/SideBar/styles.ts | 5 +- src/hooks/app/useSetUp.ts | 4 +- src/store/appStateStore.ts | 2 +- src/store/useUIStore.ts | 2 +- src/theme/palettes/light.ts | 2 +- 37 files changed, 386 insertions(+), 61 deletions(-) create mode 100644 src/components/elements/List.tsx delete mode 100644 src/containers/main/SideBar/components/OrphanChainAlert.tsx create mode 100644 src/containers/main/SideBar/components/OrphanChainAlert/OrphanChainAlert.styles.ts create mode 100644 src/containers/main/SideBar/components/OrphanChainAlert/OrphanChainAlert.tsx diff --git a/public/locales/af/mining-view.json b/public/locales/af/mining-view.json index 64ef7a511..32add90ff 100644 --- a/public/locales/af/mining-view.json +++ b/public/locales/af/mining-view.json @@ -20,6 +20,15 @@ "stop-mining": "Stop Mynbou", "waiting-for-idle": "Wag tot onaktief" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "Jy verdien belonings vir die myn van CPU en GPU afsonderlik", "you-won-block": "Jy was die wenner van blok #{{ blockHeight }}", "you-won-while-away": "Jy het {{ blocks }} gewen terwyl jy weg was", diff --git a/public/locales/af/settings.json b/public/locales/af/settings.json index 750edc826..a5aea1374 100644 --- a/public/locales/af/settings.json +++ b/public/locales/af/settings.json @@ -46,6 +46,7 @@ "title": "Tyd waarna masjien as onaktief beskou word" }, "importing-wallet": "Beursie invoer", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "Voer 24 woorde in, geskei deur spasies", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "Uitnodigingskode", @@ -84,6 +85,10 @@ "pool-mining-description": "Wanneer geaktiveer, sal u in \"n poel myn en by \"n groep mynwerkers aansluit.", "randomx-network-hash-rate": "Randomx netwerk hashrate", "refresh-versions": "Verfris weergawes", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "Rapporteer \"n probleem", "reset-permanently": "Is jy seker jy wil alle instellings permanent terugstel?", "reset-settings": "Stel Instellings Terug", @@ -111,6 +116,7 @@ "general": "Algemeen", "mining": "Mynbou", "p2p": "Poel Mynbou", + "releaseNotes": "Release Notes", "very_experimental": "Baie Eksperimenteel", "wallet": "Beursie" }, diff --git a/public/locales/cn/mining-view.json b/public/locales/cn/mining-view.json index 0cbf954ee..5b72b4314 100644 --- a/public/locales/cn/mining-view.json +++ b/public/locales/cn/mining-view.json @@ -17,6 +17,15 @@ "stop-mining": "停止挖矿", "waiting-for-idle": "等待空闲" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "您分别为 CPU 和 GPU 挖矿获得奖励", "you-won-block": "您赢得了区块 #{{ blockHeight }}", "you-won-while-away": "您在离开时赢得了 {{ blocks }}", diff --git a/public/locales/cn/settings.json b/public/locales/cn/settings.json index 09659c1b0..7ef486bde 100644 --- a/public/locales/cn/settings.json +++ b/public/locales/cn/settings.json @@ -46,6 +46,7 @@ "title": "机器被视为空闲的时间" }, "importing-wallet": "正在导入钱包", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "输入24个用空格分隔的单词", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "邀请代码", @@ -84,6 +85,10 @@ "pool-mining-description": "启用后,您将在矿池中挖矿并加入一组矿工(部落)。", "randomx-network-hash-rate": "Randomx 网络算力", "refresh-versions": "刷新版本", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "报告问题", "reset-permanently": "您确定要永久重置所有设置吗?", "reset-settings": "重置设置", @@ -111,6 +116,7 @@ "general": "常规", "mining": "挖矿", "p2p": "矿池挖矿", + "releaseNotes": "Release Notes", "very_experimental": "非常实验性", "wallet": "钱包" }, diff --git a/public/locales/de/mining-view.json b/public/locales/de/mining-view.json index 2ae914a6a..cdb4f11fc 100644 --- a/public/locales/de/mining-view.json +++ b/public/locales/de/mining-view.json @@ -16,6 +16,15 @@ "stop-mining": "Mining stoppen", "waiting-for-idle": "Warten auf Leerlauf" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "Sie verdienen Belohnungen für das Mining von CPU und GPU separat", "you-won-block": "Sie waren der Gewinner von Block #{{ blockHeight }}", "you-won-while-away": "Sie haben {{ blocks }} gewonnen, während Sie weg waren", diff --git a/public/locales/de/settings.json b/public/locales/de/settings.json index efa55121c..a4cee4eb5 100644 --- a/public/locales/de/settings.json +++ b/public/locales/de/settings.json @@ -46,6 +46,7 @@ "title": "Zeit nach der die Maschine als inaktiv betrachtet wird" }, "importing-wallet": "Wallet wird importiert", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "Geben Sie 24 Wörter ein, getrennt durch Leerzeichen", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "Einladungscode", @@ -84,6 +85,10 @@ "pool-mining-description": "Wenn aktiviert, wirst du in einem Pool minen und einer Gruppe von Minern beitreten.", "randomx-network-hash-rate": "Randomx-Netzwerk-Hashrate", "refresh-versions": "Versionen aktualisieren", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "Ein Problem melden", "reset-permanently": "Bist du sicher, dass du alle Einstellungen dauerhaft zurücksetzen möchtest?", "reset-settings": "Einstellungen zurücksetzen", @@ -111,6 +116,7 @@ "general": "Allgemein", "mining": "Mining", "p2p": "Pool-Mining", + "releaseNotes": "Release Notes", "very_experimental": "Sehr experimentell", "wallet": "Wallet" }, diff --git a/public/locales/en/mining-view.json b/public/locales/en/mining-view.json index 822262fbc..ce2537598 100644 --- a/public/locales/en/mining-view.json +++ b/public/locales/en/mining-view.json @@ -16,6 +16,15 @@ "stop-mining": "Stop Mining", "waiting-for-idle": "Waiting for Idle" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "You earn rewards for mining CPU and GPU separately", "you-won-block": "You were the winner of block #{{ blockHeight }}", "you-won-while-away": "You won {{ blocks }} while you were away", diff --git a/public/locales/en/settings.json b/public/locales/en/settings.json index 74345c1e5..2614b8b1c 100644 --- a/public/locales/en/settings.json +++ b/public/locales/en/settings.json @@ -46,6 +46,7 @@ "title": "Time after which mdchine is considered idle" }, "importing-wallet": "Importing wallet", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "Enter 24 words separated by spaces", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "Invite Code", @@ -84,6 +85,10 @@ "pool-mining-description": "When enabled, you will mine in a pool and join a group of miners.", "randomx-network-hash-rate": "Randomx network hashrate", "refresh-versions": "Refresh versions", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "Report an issue", "reset-permanently": "Are you sure you want to reset all settings permanently?", "reset-settings": "Reset Settings", @@ -111,9 +116,9 @@ "general": "General", "mining": "Mining", "p2p": "Pool Mining", + "releaseNotes": "Release Notes", "very_experimental": "Very Experimental", - "wallet": "Wallet", - "releaseNotes": "Release Notes" + "wallet": "Wallet" }, "tari-wallet-address": "Tari Wallet Address", "terms-and-conditions": "Terms & Conditions", @@ -136,9 +141,5 @@ "visual-mode": "Visual mode", "yes": "Yes", "your-feedback": "Describe your issue, including your Telegram handle if you have one, so that we can contact you with updates.", - "your-reference": "Your reference:
{{logRef}}", - "release-notes": { - "upgrade-available": "⚠️ Upgrade Available", - "loading": "Loading release notes..." - } + "your-reference": "Your reference:
{{logRef}}" } \ No newline at end of file diff --git a/public/locales/fr/mining-view.json b/public/locales/fr/mining-view.json index e5bd25968..d08321cc1 100644 --- a/public/locales/fr/mining-view.json +++ b/public/locales/fr/mining-view.json @@ -16,6 +16,15 @@ "stop-mining": "Arrêtez le minage", "waiting-for-idle": "En attente d'inactivité" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "Vous gagnez des récompenses pour le minage CPU et GPU séparément", "you-won-block": "Vous avez gagné le bloc #{{ blockHeight }}", "you-won-while-away": "Vous avez gagné {{ blocks }} pendant votre absence", diff --git a/public/locales/fr/settings.json b/public/locales/fr/settings.json index 7fc5cf9c1..89818aa67 100644 --- a/public/locales/fr/settings.json +++ b/public/locales/fr/settings.json @@ -46,6 +46,7 @@ "title": "Temps après lequel la machine est considérée comme inactive" }, "importing-wallet": "Importation du portefeuille", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "Entrez 24 mots séparés par des espaces", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "Code d\"invitation", @@ -84,6 +85,10 @@ "pool-mining-description": "Lorsqu\"il est activé, vous minerez dans un pool et rejoindrez un groupe de mineurs.", "randomx-network-hash-rate": "Taux de hachage du réseau Randomx", "refresh-versions": "Rafraîchir les versions", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "Signaler un problème", "reset-permanently": "Êtes-vous sûr de vouloir réinitialiser tous les paramètres de manière permanente ?", "reset-settings": "Réinitialiser les paramètres", @@ -111,6 +116,7 @@ "general": "Général", "mining": "Minage", "p2p": "Minage en pool", + "releaseNotes": "Release Notes", "very_experimental": "Très Expérimental", "wallet": "Portefeuille" }, diff --git a/public/locales/hi/mining-view.json b/public/locales/hi/mining-view.json index e974ef65b..7348b079e 100644 --- a/public/locales/hi/mining-view.json +++ b/public/locales/hi/mining-view.json @@ -17,6 +17,15 @@ "stop-mining": "माइनिंग रोकें", "waiting-for-idle": "निष्क्रिय होने की प्रतीक्षा" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "आप CPU और GPU माइनिंग के लिए अलग-अलग पुरस्कार अर्जित करते हैं", "you-won-block": "आप ब्लॉक #{{ blockHeight }} के विजेता थे", "you-won-while-away": "आपने {{ blocks }} जीते जब आप दूर थे", diff --git a/public/locales/hi/settings.json b/public/locales/hi/settings.json index ae80e512a..7e13a3503 100644 --- a/public/locales/hi/settings.json +++ b/public/locales/hi/settings.json @@ -46,6 +46,7 @@ "title": "समय जिसके बाद मशीन को निष्क्रिय माना जाता है" }, "importing-wallet": "वॉलेट आयात किया जा रहा है", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "24 शब्दों को स्पेस से अलग करके दर्ज करें", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "आमंत्रण कोड", @@ -84,6 +85,10 @@ "pool-mining-description": "सक्षम होने पर, आप एक पूल में माइन करेंगे और माइनर्स के समूह में शामिल होंगे।", "randomx-network-hash-rate": "Randomx नेटवर्क हैशरेट", "refresh-versions": "संस्करण ताज़ा करें", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "समस्या की रिपोर्ट करें", "reset-permanently": "क्या आप वाकई सभी सेटिंग्स को स्थायी रूप से रीसेट करना चाहते हैं?", "reset-settings": "सेटिंग्स रीसेट करें", @@ -111,6 +116,7 @@ "general": "सामान्य", "mining": "माइनिंग", "p2p": "पूल माइनिंग", + "releaseNotes": "Release Notes", "very_experimental": "बहुत प्रयोगात्मक", "wallet": "वॉलेट" }, diff --git a/public/locales/id/mining-view.json b/public/locales/id/mining-view.json index 92fe2ae40..19a9bafcd 100644 --- a/public/locales/id/mining-view.json +++ b/public/locales/id/mining-view.json @@ -17,6 +17,15 @@ "stop-mining": "Hentikan Penambangan", "waiting-for-idle": "Menunggu Tidak Aktif" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "Anda mendapatkan hadiah untuk menambang CPU dan GPU secara terpisah", "you-won-block": "Anda adalah pemenang dari blok #{{ blockHeight }}", "you-won-while-away": "Anda memenangkan {{ blocks }} saat Anda pergi", diff --git a/public/locales/id/settings.json b/public/locales/id/settings.json index ae95dca7a..415c9f751 100644 --- a/public/locales/id/settings.json +++ b/public/locales/id/settings.json @@ -46,6 +46,7 @@ "title": "Waktu setelah mesin dianggap tidak aktif" }, "importing-wallet": "Mengimpor dompet", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "Masukkan 24 kata yang dipisahkan oleh spasi", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "Kode Undangan", @@ -84,6 +85,10 @@ "pool-mining-description": "Ketika diaktifkan, Anda akan menambang dalam pool dan bergabung dengan kelompok penambang.", "randomx-network-hash-rate": "Hashrate jaringan Randomx", "refresh-versions": "Segarkan versi", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "Laporkan masalah", "reset-permanently": "Apakah Anda yakin ingin mengatur ulang semua pengaturan secara permanen?", "reset-settings": "Atur Ulang Pengaturan", @@ -111,6 +116,7 @@ "general": "Umum", "mining": "Penambangan", "p2p": "Penambangan Pool", + "releaseNotes": "Release Notes", "very_experimental": "Sangat Eksperimental", "wallet": "Dompet" }, diff --git a/public/locales/ja/mining-view.json b/public/locales/ja/mining-view.json index d7e38290a..768451a86 100644 --- a/public/locales/ja/mining-view.json +++ b/public/locales/ja/mining-view.json @@ -17,6 +17,15 @@ "stop-mining": "マイニングを停止", "waiting-for-idle": "アイドル待機中" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "CPUとGPUのマイニングで別々に報酬を得ます", "you-won-block": "ブロック #{{ blockHeight }} の勝者です", "you-won-while-away": "不在中に{{ blocks }}を獲得しました", diff --git a/public/locales/ja/settings.json b/public/locales/ja/settings.json index 97aa4a1f4..496bc3c5b 100644 --- a/public/locales/ja/settings.json +++ b/public/locales/ja/settings.json @@ -46,6 +46,7 @@ "title": "マシンがアイドルと見なされるまでの時間" }, "importing-wallet": "ウォレットのインポート", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "スペースで区切って24の単語を入力してください", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "招待コード", @@ -84,6 +85,10 @@ "pool-mining-description": "有効にすると、プールでマイニングし、マイナーのグループに参加します。", "randomx-network-hash-rate": "Randomxネットワークのハッシュレート", "refresh-versions": "バージョンを更新", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "問題を報告する", "reset-permanently": "すべての設定を永久にリセットしてもよろしいですか?", "reset-settings": "設定をリセット", @@ -111,6 +116,7 @@ "general": "一般", "mining": "マイニング", "p2p": "プールマイニング", + "releaseNotes": "Release Notes", "very_experimental": "非常に実験的", "wallet": "ウォレット" }, diff --git a/public/locales/ko/mining-view.json b/public/locales/ko/mining-view.json index b19798b95..eb56ebd74 100644 --- a/public/locales/ko/mining-view.json +++ b/public/locales/ko/mining-view.json @@ -17,6 +17,15 @@ "stop-mining": "채굴 중지", "waiting-for-idle": "유휴 상태 대기 중" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "CPU와 GPU 채굴에 대해 각각 보상을 받습니다", "you-won-block": "당신은 블록 #{{ blockHeight }}의 승자였습니다", "you-won-while-away": "자리를 비운 동안 {{ blocks }}를 획득했습니다", diff --git a/public/locales/ko/settings.json b/public/locales/ko/settings.json index 979d820ad..40da718af 100644 --- a/public/locales/ko/settings.json +++ b/public/locales/ko/settings.json @@ -46,6 +46,7 @@ "title": "기기가 유휴 상태로 간주되는 시간" }, "importing-wallet": "지갑 가져오기", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "공백으로 구분된 24개의 단어를 입력하세요", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "초대 코드", @@ -84,6 +85,10 @@ "pool-mining-description": "활성화되면 풀에서 채굴하고 마이너 그룹에 참여합니다.", "randomx-network-hash-rate": "Randomx 네트워크 해시레이트", "refresh-versions": "버전 새로고침", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "문제 보고", "reset-permanently": "모든 설정을 영구적으로 초기화하시겠습니까?", "reset-settings": "설정 초기화", @@ -111,6 +116,7 @@ "general": "일반", "mining": "채굴", "p2p": "풀 채굴", + "releaseNotes": "Release Notes", "very_experimental": "매우 실험적", "wallet": "지갑" }, diff --git a/public/locales/pl/mining-view.json b/public/locales/pl/mining-view.json index e4b7e9c8a..7dfc1bf0a 100644 --- a/public/locales/pl/mining-view.json +++ b/public/locales/pl/mining-view.json @@ -17,6 +17,15 @@ "stop-mining": "Zatrzymaj kopanie", "waiting-for-idle": "Oczekiwanie na bezczynność" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "Zarabiasz nagrody za kopanie CPU i GPU osobno", "you-won-block": "Byłeś zwycięzcą bloku #{{ blockHeight }}", "you-won-while-away": "Wygrałeś {{ blocks }} podczas swojej nieobecności", diff --git a/public/locales/pl/settings.json b/public/locales/pl/settings.json index 9f28735e2..ec5551010 100644 --- a/public/locales/pl/settings.json +++ b/public/locales/pl/settings.json @@ -47,6 +47,7 @@ "title": "Czas po którym urządzenie jest uważane za bezczynne" }, "importing-wallet": "Importowanie portfela", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "Wprowadź 24 słowa oddzielone spacjami", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "Kod Zaproszenia", @@ -86,6 +87,10 @@ "pool-mining-description": "Po włączeniu tej opcji będziesz wydobywać w puli i dołączać do grupy górników (plemienia).", "randomx-network-hash-rate": "Hashrate sieci Randomx", "refresh-versions": "Odśwież wersje", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "Zgłoś problem", "reset-permanently": "Czy na pewno chcesz trwale zresetować ustawienia?", "reset-settings": "Resetuj ustawienia", @@ -113,6 +118,7 @@ "general": "Ogólne", "mining": "Wydobycie", "p2p": "Kopanie w puli", + "releaseNotes": "Release Notes", "very_experimental": "Bardzo Eksperymentalne", "wallet": "Portfel" }, diff --git a/public/locales/ru/mining-view.json b/public/locales/ru/mining-view.json index 0ed5fcb24..da82da207 100644 --- a/public/locales/ru/mining-view.json +++ b/public/locales/ru/mining-view.json @@ -17,6 +17,15 @@ "stop-mining": "Остановить майнинг", "waiting-for-idle": "Ожидание простоя" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "Вы получаете награды за майнинг на CPU и GPU отдельно", "you-won-block": "Вы выиграли блок #{{ blockHeight }}", "you-won-while-away": "Вы выиграли {{ blocks }}, пока вас не было", diff --git a/public/locales/ru/settings.json b/public/locales/ru/settings.json index 52ea2e8b6..779df8e4b 100644 --- a/public/locales/ru/settings.json +++ b/public/locales/ru/settings.json @@ -46,6 +46,7 @@ "title": "Время, после которого машина считается в простое" }, "importing-wallet": "Импорт кошелька", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "Введите 24 слова, разделенные пробелами", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "Код приглашения", @@ -84,6 +85,10 @@ "pool-mining-description": "При включении вы будете майнить в пуле и присоединитесь к группе майнеров.", "randomx-network-hash-rate": "Хэшрейт сети Randomx", "refresh-versions": "Обновить версии", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "Сообщить о проблеме", "reset-permanently": "Вы уверены, что хотите сбросить все настройки навсегда?", "reset-settings": "Сбросить настройки", @@ -111,6 +116,7 @@ "general": "Общие", "mining": "Майнинг", "p2p": "Майнинг в пуле", + "releaseNotes": "Release Notes", "very_experimental": "Очень экспериментальные", "wallet": "Кошелек" }, diff --git a/public/locales/tr/mining-view.json b/public/locales/tr/mining-view.json index ce0475fda..54df1d55c 100644 --- a/public/locales/tr/mining-view.json +++ b/public/locales/tr/mining-view.json @@ -17,6 +17,15 @@ "stop-mining": "Madenciliği Durdur", "waiting-for-idle": "Boşta Bekliyor" }, + "orphan-chain-tooltip": { + "heading": "Things to try:", + "step_1": "Check your Internet connection", + "step_2": "Wait 30 mins", + "step_3": "Restart the app", + "step_4": "Try using a Tor Bridge (in Settings)", + "step_5": "Try disabling Tor (in Settings)", + "step_6": "Try an app reset (in Settings)" + }, "you-earn-rewards-separately": "CPU ve GPU madenciliği için ayrı ayrı ödüller kazanırsınız", "you-won-block": "blok #{{ blockHeight }} kazananı siz oldunuz", "you-won-while-away": "Uzakta olduğunuzda {{ blocks }} kazandınız", diff --git a/public/locales/tr/settings.json b/public/locales/tr/settings.json index 3b68f56ba..c1ff96255 100644 --- a/public/locales/tr/settings.json +++ b/public/locales/tr/settings.json @@ -46,6 +46,7 @@ "title": "Makinenin boşta sayılacağı süre" }, "importing-wallet": "Cüzdan İçe Aktarılıyor", + "importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported", "invalid-seed-words": "Boşluklarla ayrılmış 24 kelime girin", "invalid-stats-server-port": "Invalid stats server port", "inviteCode": "Davet Kodu", @@ -84,6 +85,10 @@ "pool-mining-description": "Etkinleştirildiğinde, bir havuzda madencilik yapacak ve bir grup madenciye (kabileye) katılacaksınız.", "randomx-network-hash-rate": "Randomx ağ hash oranı", "refresh-versions": "Sürümleri yenileyin", + "release-notes": { + "loading": "Loading release notes...", + "upgrade-available": "⚠️ Upgrade Available" + }, "report-issue": "Bir sorunu bildir", "reset-permanently": "Tüm ayarları kalıcı olarak sıfırlamak istediğinizden emin misiniz?", "reset-settings": "Ayarları sıfırla", @@ -111,6 +116,7 @@ "general": "Genel", "mining": "Madencilik", "p2p": "Havuz Madenciliği", + "releaseNotes": "Release Notes", "very_experimental": "Çok Deneysel", "wallet": "Cüzdan" }, diff --git a/src/components/AdminUI/groups/OtherUIGroup.tsx b/src/components/AdminUI/groups/OtherUIGroup.tsx index 4f09cface..089434530 100644 --- a/src/components/AdminUI/groups/OtherUIGroup.tsx +++ b/src/components/AdminUI/groups/OtherUIGroup.tsx @@ -18,6 +18,12 @@ export function OtherUIGroup() { + {/* TODO: add the other sections if we want */} diff --git a/src/components/elements/List.tsx b/src/components/elements/List.tsx new file mode 100644 index 000000000..d2fbb33dd --- /dev/null +++ b/src/components/elements/List.tsx @@ -0,0 +1,31 @@ +import styled from 'styled-components'; + +const ListItem = styled.li` + color: ${({ theme }) => theme.palette.text.secondary}; + font-size: 12px; + font-weight: 400; +`; + +const ListWrapper = styled.div` + display: flex; + width: 100%; + ol, + ul { + max-width: 100%; + padding: 0; + padding-inline-start: 20px; + line-height: 1.35; + margin: 0; + } +`; + +interface ListProps { + items: string[]; + ordered?: boolean; +} + +export const List = ({ items, ordered = false }: ListProps) => { + const itemMarkup = items?.map((item, i) => {item}); + + return {ordered ?
    {itemMarkup}
: }
; +}; diff --git a/src/containers/floating/Settings/sections/wallet/SeedWordsMarkup/SeedWordsEdit.tsx b/src/containers/floating/Settings/sections/wallet/SeedWordsMarkup/SeedWordsEdit.tsx index bc0417d90..5428db9bd 100644 --- a/src/containers/floating/Settings/sections/wallet/SeedWordsMarkup/SeedWordsEdit.tsx +++ b/src/containers/floating/Settings/sections/wallet/SeedWordsMarkup/SeedWordsEdit.tsx @@ -53,8 +53,15 @@ export const GreyTypography = styled(Typography)(({ theme }) => ({ const seedWordsRegex = /^(([a-zA-Z]+)\s){23}([a-zA-Z]+)$/; +const dialogStyles = { + width: '380px', + padding: '16px 30px', + gap: 16, +}; + export const SeedWordsEdit = ({ seedWords, seedWordsFetching, toggleEdit }: SeedWordsEditProps) => { const [showConfirm, setShowConfirm] = useState(false); + const [newSeedWords, setNewSeedWords] = useState(); const importSeedWords = useWalletStore((s) => s.importSeedWords); const isWalletImporting = useWalletStore((s) => s.is_wallet_importing); @@ -158,16 +165,22 @@ export const SeedWordsEdit = ({ seedWords, seedWordsFetching, toggleEdit }: Seed {errors.seedWords && errors.seedWords.message} - - - {t('importing-wallet')} - + + + {t('importing-wallet')} + + + {t('importing-wallet-copy')} + +
+ +
- - + + {t('confirm-import-wallet')} {t('confirm-import-wallet-copy')} diff --git a/src/containers/main/SideBar/SideBar.tsx b/src/containers/main/SideBar/SideBar.tsx index 722fa5a59..8dd0f940e 100644 --- a/src/containers/main/SideBar/SideBar.tsx +++ b/src/containers/main/SideBar/SideBar.tsx @@ -4,8 +4,8 @@ import Heading from './components/Heading'; import LostConnectionAlert from './components/LostConnectionAlert'; import MiningButton from './components/MiningButton/MiningButton'; import Miner from './Miner/Miner'; +import OrphanChainAlert from './components/OrphanChainAlert/OrphanChainAlert.tsx'; import { Bottom, Scroll, SideBarContainer, SidebarTop, Top } from './styles'; -import OrphanChainAlert from './components/OrphanChainAlert.tsx'; export default function SideBar() { return ( diff --git a/src/containers/main/SideBar/components/LostConnectionAlert.tsx b/src/containers/main/SideBar/components/LostConnectionAlert.tsx index 14013ac42..25b5e5f6f 100644 --- a/src/containers/main/SideBar/components/LostConnectionAlert.tsx +++ b/src/containers/main/SideBar/components/LostConnectionAlert.tsx @@ -18,13 +18,11 @@ const LostConnectionAlert = () => { const isSettingUp = useAppStateStore((s) => s.isSettingUp); return !isConnectedToTari && !isSettingUp ? ( - - + + {t('lost-connection')} - ) : ( - <> - ); + ) : null; }; export default LostConnectionAlert; diff --git a/src/containers/main/SideBar/components/OrphanChainAlert.tsx b/src/containers/main/SideBar/components/OrphanChainAlert.tsx deleted file mode 100644 index d888789af..000000000 --- a/src/containers/main/SideBar/components/OrphanChainAlert.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { IoAlertCircleSharp } from 'react-icons/io5'; -import { Stack } from '@app/components/elements/Stack'; -import { Typography } from '@app/components/elements/Typography'; -import { useTranslation } from 'react-i18next'; -import styled from 'styled-components'; -import { useEffect, useState } from 'react'; -import { listen } from '@tauri-apps/api/event'; - -const LostConnectionIcon = styled(IoAlertCircleSharp)(({ theme }) => ({ - color: theme.palette.warning.main, -})); - -export const OrphanChainAlert = () => { - const [isOrphanChain, setIsOrphanChain] = useState(false); - const { t } = useTranslation('settings', { useSuspense: false }); - - useEffect(() => { - const unlistenPromise = listen('is_stuck', (event) => { - setIsOrphanChain(event.payload); - }); - return () => { - unlistenPromise.then((unlisten) => unlisten()); - }; - }, [setIsOrphanChain]); - - return isOrphanChain ? ( - - - {t('is-on-orphan-chain')} - - ) : ( - <> - ); -}; - -export default OrphanChainAlert; diff --git a/src/containers/main/SideBar/components/OrphanChainAlert/OrphanChainAlert.styles.ts b/src/containers/main/SideBar/components/OrphanChainAlert/OrphanChainAlert.styles.ts new file mode 100644 index 000000000..5527ce52f --- /dev/null +++ b/src/containers/main/SideBar/components/OrphanChainAlert/OrphanChainAlert.styles.ts @@ -0,0 +1,56 @@ +import styled from 'styled-components'; + +import { m } from 'framer-motion'; +import { convertHexToRGBA } from '@app/utils'; + +export const AlertWrapper = styled.div` + display: flex; + position: relative; +`; + +export const AlertIconWrapper = styled.div` + display: flex; + background: ${({ theme }) => convertHexToRGBA(theme.palette.contrast, 0.1)}; + color: ${({ theme }) => theme.palette.text.secondary}; + flex-shrink: 0; + border-radius: 100%; + width: 14px; + height: 14px; +`; +export const TooltipTrigger = styled.div` + cursor: pointer; + display: flex; + padding: 6px 8px 4px; + flex-direction: row; + font-size: 0.7rem; + gap: 4px; + align-items: flex-start; + color: ${({ theme }) => theme.palette.warning.dark}; +`; + +export const TooltipWrapper = styled(m.div).attrs({ + initial: { opacity: 0 }, + animate: { opacity: 1 }, +})` + display: flex; + flex-direction: column; + border-radius: ${({ theme }) => theme.shape.borderRadius.app}; + background-color: ${({ theme }) => theme.palette.background.default}; + box-shadow: 2px 8px 8px 0 rgba(0, 0, 0, 0.04); + position: absolute; + padding: 6px 8px 10px; + gap: 6px; + left: 0; + top: 100%; + z-index: 2; + width: 100%; +`; + +export const TooltipTop = styled.div` + display: flex; + align-items: center; + gap: 6px; + img { + max-height: 12px; + } +`; diff --git a/src/containers/main/SideBar/components/OrphanChainAlert/OrphanChainAlert.tsx b/src/containers/main/SideBar/components/OrphanChainAlert/OrphanChainAlert.tsx new file mode 100644 index 000000000..153e0ac59 --- /dev/null +++ b/src/containers/main/SideBar/components/OrphanChainAlert/OrphanChainAlert.tsx @@ -0,0 +1,79 @@ +import { Typography } from '@app/components/elements/Typography'; +import { useTranslation } from 'react-i18next'; +import { useEffect, useState } from 'react'; +import { listen } from '@tauri-apps/api/event'; +import { autoUpdate, safePolygon, useFloating, useHover, useInteractions } from '@floating-ui/react'; +import { + TooltipTrigger, + AlertWrapper, + TooltipWrapper, + TooltipTop, + AlertIconWrapper, +} from './OrphanChainAlert.styles.ts'; +import { AnimatePresence } from 'framer-motion'; +import { List } from '@app/components/elements/List.tsx'; + +import tinkerEmoji from '@app/assets/icons/emoji/custom.png'; +import { useUIStore } from '@app/store/useUIStore.ts'; +import QuestionMarkSvg from '@app/components/svgs/QuestionMarkSvg.tsx'; + +export const OrphanChainAlert = () => { + const { t } = useTranslation(['settings', 'mining-view'], { useSuspense: false }); + const adminShow = useUIStore((s) => s.adminShow); + const [isOrphanChain, setIsOrphanChain] = useState(false); + + const [open, setOpen] = useState(false); + const { refs, context } = useFloating({ + open: open, + onOpenChange: setOpen, + + whileElementsMounted(referenceEl, floatingEl, update) { + return autoUpdate(referenceEl, floatingEl, update, { + layoutShift: false, + }); + }, + }); + + const hover = useHover(context, { + move: !open, + handleClose: safePolygon(), + }); + const { getReferenceProps, getFloatingProps } = useInteractions([hover]); + + useEffect(() => { + const unlistenPromise = listen('is_stuck', (event) => { + setIsOrphanChain(event.payload); + }); + return () => { + unlistenPromise.then((unlisten) => unlisten()); + }; + }, [setIsOrphanChain]); + + const steps = Array.from({ length: 6 }).map((_, i) => t(`mining-view:orphan-chain-tooltip.step_${i + 1}`)); + + const alertMarkup = ( + + + {t('is-on-orphan-chain')} + + + + + + {open && ( + + + + {t('mining-view:orphan-chain-tooltip.heading')} + + + + )} + + + ); + + return isOrphanChain || adminShow === 'orphanChainWarning' ? alertMarkup : null; +}; + +export default OrphanChainAlert; diff --git a/src/containers/main/SideBar/styles.ts b/src/containers/main/SideBar/styles.ts index 3581b1ad1..29725cc8d 100644 --- a/src/containers/main/SideBar/styles.ts +++ b/src/containers/main/SideBar/styles.ts @@ -38,7 +38,7 @@ export const SidebarTop = styled('div')` display: flex; flex-direction: column; padding: 0 10px 10px 10px; - gap: 20px; + gap: 10px; @media (max-height: 670px) { gap: 5px; @@ -50,4 +50,7 @@ export const Bottom = styled(m.div)` flex-direction: column; gap: 12px; padding-bottom: 188px; // to cater for wallet card + @media (max-height: 670px) { + padding-bottom: 150px; + } `; diff --git a/src/hooks/app/useSetUp.ts b/src/hooks/app/useSetUp.ts index 389c48fc8..c52aca6cf 100644 --- a/src/hooks/app/useSetUp.ts +++ b/src/hooks/app/useSetUp.ts @@ -50,14 +50,14 @@ export function useSetUp() { useEffect(() => { if (adminShow === 'setup') return; - const unlistenPromise = listen('message', ({ event: e, payload: p }: TauriEvent) => { + const unlistenPromise = listen('message', async ({ event: e, payload: p }: TauriEvent) => { switch (p.event_type) { case 'setup_status': if (p.progress > 0) { setSetupDetails(p.title, p.title_params, p.progress); } if (p.progress >= 1) { - handlePostSetup(); + await handlePostSetup(); } break; default: diff --git a/src/store/appStateStore.ts b/src/store/appStateStore.ts index fc1111334..1f5869cf2 100644 --- a/src/store/appStateStore.ts +++ b/src/store/appStateStore.ts @@ -64,7 +64,6 @@ export const useAppStateStore = create()((set, getState) => ({ isSettingUp: true, setIsSettingUp: (value: boolean) => set({ isSettingUp: value }), setSettingUpFinished: async () => { - set({ isSettingUp: false }); setAnimationState('showVisual'); // Proceed with auto mining when enabled @@ -73,6 +72,7 @@ export const useAppStateStore = create()((set, getState) => ({ const startMining = useMiningStore.getState().startMining; await startMining(); } + set({ isSettingUp: false }); }, applications_versions: undefined, fetchApplicationsVersions: async () => { diff --git a/src/store/useUIStore.ts b/src/store/useUIStore.ts index 3e200e808..d009c181c 100644 --- a/src/store/useUIStore.ts +++ b/src/store/useUIStore.ts @@ -18,7 +18,7 @@ interface State { showExternalDependenciesDialog: boolean; dialogToShow?: DialogType | null; isWebglNotSupported: boolean; - adminShow?: 'setup' | 'main' | 'shutdown' | null; + adminShow?: 'setup' | 'main' | 'shutdown' | 'orphanChainWarning' | null; } interface Actions { setTheme: (theme: Theme) => void; diff --git a/src/theme/palettes/light.ts b/src/theme/palettes/light.ts index 25e96d8cf..9f3d50cc4 100644 --- a/src/theme/palettes/light.ts +++ b/src/theme/palettes/light.ts @@ -69,7 +69,7 @@ const lightPalette: ThemePalette = { }, warning: { main: c.warning[400], - dark: c.warning[950], + dark: c.warning[800], light: c.warning[50], contrast: c.warning[300], wisp: colorsAlpha.warningDarkAlpha[5], From 2f5274550c8aaa9f0318779a80b9257052a83f6c Mon Sep 17 00:00:00 2001 From: stringhandler Date: Tue, 10 Dec 2024 16:45:23 +0200 Subject: [PATCH 2/7] chore: autoupdate 0.8.9 --- .updater/latest.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.updater/latest.json b/.updater/latest.json index 4bf6138f7..e4e5fa8b8 100644 --- a/.updater/latest.json +++ b/.updater/latest.json @@ -1,23 +1,23 @@ { - "version": "0.8.7", + "version": "0.8.9", "notes": "Tari Universe - See the assets to download this version and install", - "pub_date": "2024-12-05T17:16:20.900Z", + "pub_date": "2024-12-10T11:19:32.841Z", "platforms": { "linux-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFcrRnF2NFYxZk1INmJrK25WMjFGbGZHdGdqNmUzdWcrOXRBekFTYXFzK3UrSVptcW1FWG00T3JUZnE4T1FqUjVIU1pLRXVWRVI2VXFUamkvOWpPb0FRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE2NjQzCWZpbGU6dGFyaS11bml2ZXJzZV8wLjguN19hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKNHJ5dzgvcHdMTjRGbVRGYlZyY01yZ0U2dnZCM3VRTEtuUlBpR3pBa0R1ZkpoN2NEbU5SZGRLKy8reXhEY3ZnZUVDYWZIQlE5MHRQbUFPcEsySW5PREE9PQo=", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/tari-universe_0.8.7_amd64.AppImage.tar.gz" - }, - "windows-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGU0b0lRSUI2MDdQWVB6T1dtbzJqVVRra3BkaVY1NGNaQ0NKVHgwdkpybGcySmpwRXdRbkNhTHRFRFVhZmVBM2d2ZVdOWkNTYkh2Qi90KytwWFMzT2c4PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE3NzMzCWZpbGU6VGFyaSBVbml2ZXJzZV8wLjguN194NjRfZW4tVVMubXNpLnppcApCOUlsZnZ4clA4SlJEYXJabk91MExTbHhBUW9mc2JrNFNOTzJZaVo1VHdhQjRqL0dKaWIyTnFmNFE5NmtGRncwWmpiUEJPZ1lNUi9xN1Y5ZHVoYVNEdz09Cg==", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_0.8.7_x64_en-US.msi.zip" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFlhQzZTS2ZOSHZRczVtUExVS2ZvQUU1VWU2S0pqVktSTWNrTkhHd0hNRGZ1NGdHUUgyS082TkFsQldjeEdBUDByTE1FMElESm1VZzdiWmZqcGVYcmc4PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI4ODA0CWZpbGU6dGFyaS11bml2ZXJzZV8wLjguOV9hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKZmhNV09nWlNjamN6bk12Z0V2RUpMZ2VXNmVyYlo3Yk4zMzFZYjEwUUY4MkFuaUxkYjVhUzU5QXJlbndIdS9LZWkrQ1FnS3ROMzgwazk2RXJnb3Y3Q1E9PQo=", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/tari-universe_0.8.9_amd64.AppImage.tar.gz" }, "darwin-aarch64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGVBSGtCQWlybHR4TVdVNThNS0Y1MFNSWDlkZE1TNk9YVkhZV2F1dVZEQWtZenlOM0xBaVVsWjJWZ0MzOUZjMzNrV1krY2k3OTBKeWZrdVQ1L3ZXUWdRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE4OTY0CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CitDT0o5UXJpTWpPQVBDVzI1amVaOUQwZGNveEtjTy8wMlp3dnFxWGZMWWF2bWdPelBrR2pJRy90Q0MvdTNqM29ydkN4R0VHaTMxQW1maVVPRU5CQURRPT0K", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_universal.app.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGZsVU1vaHpWUXR0eVJDcmVqZ2JNbC9xdGRlVU9LUlJHYmNSWk1oQU9KYXpoUVFhWWRMdXpENFZJVVRQRmFlaDFkWkluUnZDU2hwbWswMFhVOWJHNGdjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5Mzg4CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CjlLTzB6TEcwSm1GaU5pWGV1VWIxRTRTTFlXaVdHY1lmR3UzQ05IRDRGT2x0TXFqd2FsYmI2TGZiVnh1cFFlSHJPVDZ3bjN5SDh2QkNhUW1PSElrMkNnPT0K", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_universal.app.tar.gz" }, "darwin-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGVBSGtCQWlybHR4TVdVNThNS0Y1MFNSWDlkZE1TNk9YVkhZV2F1dVZEQWtZenlOM0xBaVVsWjJWZ0MzOUZjMzNrV1krY2k3OTBKeWZrdVQ1L3ZXUWdRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE4OTY0CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CitDT0o5UXJpTWpPQVBDVzI1amVaOUQwZGNveEtjTy8wMlp3dnFxWGZMWWF2bWdPelBrR2pJRy90Q0MvdTNqM29ydkN4R0VHaTMxQW1maVVPRU5CQURRPT0K", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_universal.app.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGZsVU1vaHpWUXR0eVJDcmVqZ2JNbC9xdGRlVU9LUlJHYmNSWk1oQU9KYXpoUVFhWWRMdXpENFZJVVRQRmFlaDFkWkluUnZDU2hwbWswMFhVOWJHNGdjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5Mzg4CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CjlLTzB6TEcwSm1GaU5pWGV1VWIxRTRTTFlXaVdHY1lmR3UzQ05IRDRGT2x0TXFqd2FsYmI2TGZiVnh1cFFlSHJPVDZ3bjN5SDh2QkNhUW1PSElrMkNnPT0K", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_universal.app.tar.gz" + }, + "windows-x86_64": { + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFdIeFFZRGxxT3NYbHQwb0tUU2lzbmRSdGcyWmpIcnBzMHpYcnJWSkdWcnJKYlJ4VnlwemNBOUh3NStqU3o0cXNMdS9IaE5uQ3Z2SGczM2NlMXhDVHdFPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5NTY2CWZpbGU6VGFyaSBVbml2ZXJzZV8wLjguOV94NjRfZW4tVVMubXNpLnppcApTUGxYMFdNOHdpZGhNOVluNktHd2M3QXl2VlpVQTVSNGpKUU9vN29LTEVCQUVtdXE0cjc0akU3cTZLbS91OUovZXVVcDlXSllROFJkbHcrdHVWZkhEdz09Cg==", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_0.8.9_x64_en-US.msi.zip" } } } \ No newline at end of file From f3e8a9e640632aad70c456120b27136f4a43dae1 Mon Sep 17 00:00:00 2001 From: stringhandler Date: Tue, 10 Dec 2024 16:57:58 +0200 Subject: [PATCH 3/7] chore: rollback autoupdate --- .updater/latest.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.updater/latest.json b/.updater/latest.json index e4e5fa8b8..4bf6138f7 100644 --- a/.updater/latest.json +++ b/.updater/latest.json @@ -1,23 +1,23 @@ { - "version": "0.8.9", + "version": "0.8.7", "notes": "Tari Universe - See the assets to download this version and install", - "pub_date": "2024-12-10T11:19:32.841Z", + "pub_date": "2024-12-05T17:16:20.900Z", "platforms": { "linux-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFlhQzZTS2ZOSHZRczVtUExVS2ZvQUU1VWU2S0pqVktSTWNrTkhHd0hNRGZ1NGdHUUgyS082TkFsQldjeEdBUDByTE1FMElESm1VZzdiWmZqcGVYcmc4PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI4ODA0CWZpbGU6dGFyaS11bml2ZXJzZV8wLjguOV9hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKZmhNV09nWlNjamN6bk12Z0V2RUpMZ2VXNmVyYlo3Yk4zMzFZYjEwUUY4MkFuaUxkYjVhUzU5QXJlbndIdS9LZWkrQ1FnS3ROMzgwazk2RXJnb3Y3Q1E9PQo=", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/tari-universe_0.8.9_amd64.AppImage.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFcrRnF2NFYxZk1INmJrK25WMjFGbGZHdGdqNmUzdWcrOXRBekFTYXFzK3UrSVptcW1FWG00T3JUZnE4T1FqUjVIU1pLRXVWRVI2VXFUamkvOWpPb0FRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE2NjQzCWZpbGU6dGFyaS11bml2ZXJzZV8wLjguN19hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKNHJ5dzgvcHdMTjRGbVRGYlZyY01yZ0U2dnZCM3VRTEtuUlBpR3pBa0R1ZkpoN2NEbU5SZGRLKy8reXhEY3ZnZUVDYWZIQlE5MHRQbUFPcEsySW5PREE9PQo=", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/tari-universe_0.8.7_amd64.AppImage.tar.gz" + }, + "windows-x86_64": { + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGU0b0lRSUI2MDdQWVB6T1dtbzJqVVRra3BkaVY1NGNaQ0NKVHgwdkpybGcySmpwRXdRbkNhTHRFRFVhZmVBM2d2ZVdOWkNTYkh2Qi90KytwWFMzT2c4PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE3NzMzCWZpbGU6VGFyaSBVbml2ZXJzZV8wLjguN194NjRfZW4tVVMubXNpLnppcApCOUlsZnZ4clA4SlJEYXJabk91MExTbHhBUW9mc2JrNFNOTzJZaVo1VHdhQjRqL0dKaWIyTnFmNFE5NmtGRncwWmpiUEJPZ1lNUi9xN1Y5ZHVoYVNEdz09Cg==", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_0.8.7_x64_en-US.msi.zip" }, "darwin-aarch64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGZsVU1vaHpWUXR0eVJDcmVqZ2JNbC9xdGRlVU9LUlJHYmNSWk1oQU9KYXpoUVFhWWRMdXpENFZJVVRQRmFlaDFkWkluUnZDU2hwbWswMFhVOWJHNGdjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5Mzg4CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CjlLTzB6TEcwSm1GaU5pWGV1VWIxRTRTTFlXaVdHY1lmR3UzQ05IRDRGT2x0TXFqd2FsYmI2TGZiVnh1cFFlSHJPVDZ3bjN5SDh2QkNhUW1PSElrMkNnPT0K", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_universal.app.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGVBSGtCQWlybHR4TVdVNThNS0Y1MFNSWDlkZE1TNk9YVkhZV2F1dVZEQWtZenlOM0xBaVVsWjJWZ0MzOUZjMzNrV1krY2k3OTBKeWZrdVQ1L3ZXUWdRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE4OTY0CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CitDT0o5UXJpTWpPQVBDVzI1amVaOUQwZGNveEtjTy8wMlp3dnFxWGZMWWF2bWdPelBrR2pJRy90Q0MvdTNqM29ydkN4R0VHaTMxQW1maVVPRU5CQURRPT0K", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_universal.app.tar.gz" }, "darwin-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGZsVU1vaHpWUXR0eVJDcmVqZ2JNbC9xdGRlVU9LUlJHYmNSWk1oQU9KYXpoUVFhWWRMdXpENFZJVVRQRmFlaDFkWkluUnZDU2hwbWswMFhVOWJHNGdjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5Mzg4CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CjlLTzB6TEcwSm1GaU5pWGV1VWIxRTRTTFlXaVdHY1lmR3UzQ05IRDRGT2x0TXFqd2FsYmI2TGZiVnh1cFFlSHJPVDZ3bjN5SDh2QkNhUW1PSElrMkNnPT0K", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_universal.app.tar.gz" - }, - "windows-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFdIeFFZRGxxT3NYbHQwb0tUU2lzbmRSdGcyWmpIcnBzMHpYcnJWSkdWcnJKYlJ4VnlwemNBOUh3NStqU3o0cXNMdS9IaE5uQ3Z2SGczM2NlMXhDVHdFPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5NTY2CWZpbGU6VGFyaSBVbml2ZXJzZV8wLjguOV94NjRfZW4tVVMubXNpLnppcApTUGxYMFdNOHdpZGhNOVluNktHd2M3QXl2VlpVQTVSNGpKUU9vN29LTEVCQUVtdXE0cjc0akU3cTZLbS91OUovZXVVcDlXSllROFJkbHcrdHVWZkhEdz09Cg==", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_0.8.9_x64_en-US.msi.zip" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGVBSGtCQWlybHR4TVdVNThNS0Y1MFNSWDlkZE1TNk9YVkhZV2F1dVZEQWtZenlOM0xBaVVsWjJWZ0MzOUZjMzNrV1krY2k3OTBKeWZrdVQ1L3ZXUWdRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE4OTY0CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CitDT0o5UXJpTWpPQVBDVzI1amVaOUQwZGNveEtjTy8wMlp3dnFxWGZMWWF2bWdPelBrR2pJRy90Q0MvdTNqM29ydkN4R0VHaTMxQW1maVVPRU5CQURRPT0K", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_universal.app.tar.gz" } } } \ No newline at end of file From cce052b578c93fe3adc707fd9d8cfae8d1282ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Papie=C5=BC?= Date: Tue, 10 Dec 2024 23:11:37 +0100 Subject: [PATCH 4/7] feat: improve updater for tauri v2 & handle pre-release (#1204) Description --- This pull request introduces support pre-release versions, placed in settings. It also contains creating `UpdatesManager` on the backend side, which is kinda refactor of the previous updater implementation for Tauri V1. * Added `pre_release` field to `AppConfig`, placed in "General Settings" * Moved updater logic to the backend, created `UpdatesManager` to handle all related logic and provide straightforward commands. It gives us more control over the updates flow and far more space for debugging. * Updater Dialog UI is not changed, it's just "dumb" and react to the events from rust. User shouldn't see any significant change How it works --- * When the pre-release version is enabled, the application retrieves the latest versions from `alpha-latest.json`. Disabling this flag immediately updates the application to the non-pre-release version. * When the pre-release version is disabled, the application fetches the latest versions from `latest.json`. From the user's perspective, there should be no significant changes. Enabling this flag instantly updates the application to the pre-release version. Motivation and Context --- #518 - Since we upgraded Tauri to v2, we can now handle pre-release versions. We use [Tauri Dynamic Update Server](https://v2.tauri.app/plugin/updater/#dynamic-update-server) to achieve this. This required us to move updater logic to the backend. What process can a PR reviewer use to test or verify this change? --- Testable on development environment. Play with this by changing * `tauri-conf.json` version to set the "current" app version * `latest.json` version to set the latest non-pre-release version * `alpha.json` version to set the latest pre-release version Toggle "pre_release" flag in the settings to switch between these app versions, turn on/off the `auto_update flag` and see how it affects the app. You can also update the app via "Release Notes" section --------- Co-authored-by: brianp --- public/locales/af/settings.json | 8 + public/locales/cn/settings.json | 8 + public/locales/de/settings.json | 8 + public/locales/en/settings.json | 8 + public/locales/fr/settings.json | 8 + public/locales/hi/settings.json | 8 + public/locales/id/settings.json | 8 + public/locales/ja/settings.json | 8 + public/locales/ko/settings.json | 8 + public/locales/pl/settings.json | 8 + public/locales/ru/settings.json | 8 + public/locales/tr/settings.json | 8 + src-tauri/src/app_config.rs | 21 ++ src-tauri/src/commands.rs | 88 +++++++ src-tauri/src/main.rs | 16 +- src-tauri/src/updates_manager.rs | 221 ++++++++++++++++++ src/App/AppWrapper.tsx | 15 +- src/components/dialogs/ConfirmationDialog.tsx | 62 +++++ .../AutoUpdateDialog/AutoUpdateDialog.tsx | 85 +++++-- .../sections/general/GeneralSettings.tsx | 2 + .../sections/general/PreReleaseSettings.tsx | 57 +++++ .../sections/releaseNotes/ReleaseNotes.tsx | 21 +- src/hooks/app/index.ts | 1 - src/hooks/app/useSetUp.ts | 13 +- src/hooks/app/useUpdateStatus.ts | 90 ------- src/store/appStateStore.ts | 4 - src/store/useAppConfigStore.ts | 11 + src/types/app-status.ts | 1 + src/types/invoke.ts | 4 + 29 files changed, 658 insertions(+), 150 deletions(-) create mode 100644 src-tauri/src/updates_manager.rs create mode 100644 src/components/dialogs/ConfirmationDialog.tsx create mode 100644 src/containers/floating/Settings/sections/general/PreReleaseSettings.tsx delete mode 100644 src/hooks/app/useUpdateStatus.ts diff --git a/public/locales/af/settings.json b/public/locales/af/settings.json index a5aea1374..79a58462c 100644 --- a/public/locales/af/settings.json +++ b/public/locales/af/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "Pas Uitnodigingskode Toe", "cancel": "Cancel", "change-language": "Verander taal", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Abandon current wallet?", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?", "connected-peers": "Gekoppelde Eweknieë", @@ -83,6 +85,11 @@ }, "pool-mining": "Poel Mynbou", "pool-mining-description": "Wanneer geaktiveer, sal u in \"n poel myn en by \"n groep mynwerkers aansluit.", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Randomx netwerk hashrate", "refresh-versions": "Verfris weergawes", "release-notes": { @@ -108,6 +115,7 @@ "title": "Outomatiese begin by stelsel opstart" }, "should-use-system-language": "Gebruik stelsel taal", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "Airdrop", diff --git a/public/locales/cn/settings.json b/public/locales/cn/settings.json index 7ef486bde..a25b19c23 100644 --- a/public/locales/cn/settings.json +++ b/public/locales/cn/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "应用邀请代码", "cancel": "取消", "change-language": "更改语言", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Abandon current wallet?", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?", "connected-peers": "已连接的节点", @@ -83,6 +85,11 @@ }, "pool-mining": "矿池挖矿", "pool-mining-description": "启用后,您将在矿池中挖矿并加入一组矿工(部落)。", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Randomx 网络算力", "refresh-versions": "刷新版本", "release-notes": { @@ -108,6 +115,7 @@ "title": "系统启动时自动启动" }, "should-use-system-language": "使用系统语言", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "空投", diff --git a/public/locales/de/settings.json b/public/locales/de/settings.json index a4cee4eb5..97ce82b9c 100644 --- a/public/locales/de/settings.json +++ b/public/locales/de/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "Einladungscode anwenden", "cancel": "Abbrechen", "change-language": "Sprache", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Abandon current wallet?", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?", "connected-peers": "Verbundenen Peers", @@ -83,6 +85,11 @@ }, "pool-mining": "Pool-Mining", "pool-mining-description": "Wenn aktiviert, wirst du in einem Pool minen und einer Gruppe von Minern beitreten.", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Randomx-Netzwerk-Hashrate", "refresh-versions": "Versionen aktualisieren", "release-notes": { @@ -108,6 +115,7 @@ "title": "Automatischer Start beim Systemstart" }, "should-use-system-language": "Systemsprache verwenden", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "Airdrop", diff --git a/public/locales/en/settings.json b/public/locales/en/settings.json index 2614b8b1c..c857a8755 100644 --- a/public/locales/en/settings.json +++ b/public/locales/en/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "Apply Invite Code", "cancel": "Cancel", "change-language": "Language", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Import new wallet", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?\nYour current wallet will be abandoned.", "connected-peers": "Connected Peers", @@ -83,6 +85,11 @@ }, "pool-mining": "Pool Mining", "pool-mining-description": "When enabled, you will mine in a pool and join a group of miners.", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Randomx network hashrate", "refresh-versions": "Refresh versions", "release-notes": { @@ -108,6 +115,7 @@ "title": "Auto-start on system boot" }, "should-use-system-language": "Use system language", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "Airdrop", diff --git a/public/locales/fr/settings.json b/public/locales/fr/settings.json index 89818aa67..093fae309 100644 --- a/public/locales/fr/settings.json +++ b/public/locales/fr/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "Appliquer le code d\"invitation", "cancel": "Cancel", "change-language": "Langue", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Abandon current wallet?", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?", "connected-peers": "Pairs connectés", @@ -83,6 +85,11 @@ }, "pool-mining": "Minage en pool", "pool-mining-description": "Lorsqu\"il est activé, vous minerez dans un pool et rejoindrez un groupe de mineurs.", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Taux de hachage du réseau Randomx", "refresh-versions": "Rafraîchir les versions", "release-notes": { @@ -108,6 +115,7 @@ "title": "Démarrage automatique au démarrage du système" }, "should-use-system-language": "Utiliser la langue du système", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "Airdrop", diff --git a/public/locales/hi/settings.json b/public/locales/hi/settings.json index 7e13a3503..44135d491 100644 --- a/public/locales/hi/settings.json +++ b/public/locales/hi/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "आमंत्रण कोड लागू करें", "cancel": "रद्द करें", "change-language": "भाषा", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Abandon current wallet?", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?", "connected-peers": "जुड़े हुए सहकर्मी", @@ -83,6 +85,11 @@ }, "pool-mining": "पूल माइनिंग", "pool-mining-description": "सक्षम होने पर, आप एक पूल में माइन करेंगे और माइनर्स के समूह में शामिल होंगे।", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Randomx नेटवर्क हैशरेट", "refresh-versions": "संस्करण ताज़ा करें", "release-notes": { @@ -108,6 +115,7 @@ "title": "सिस्टम बूट पर स्वचालित शुरूआत" }, "should-use-system-language": "सिस्टम भाषा का उपयोग करें", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "एयरड्रॉप", diff --git a/public/locales/id/settings.json b/public/locales/id/settings.json index 415c9f751..3d8f6559a 100644 --- a/public/locales/id/settings.json +++ b/public/locales/id/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "Terapkan Kode Undangan", "cancel": "Batal", "change-language": "Bahasa", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Abandon current wallet?", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?", "connected-peers": "Rekan Terhubung", @@ -83,6 +85,11 @@ }, "pool-mining": "Penambangan Pool", "pool-mining-description": "Ketika diaktifkan, Anda akan menambang dalam pool dan bergabung dengan kelompok penambang.", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Hashrate jaringan Randomx", "refresh-versions": "Segarkan versi", "release-notes": { @@ -108,6 +115,7 @@ "title": "Mulai otomatis saat boot sistem" }, "should-use-system-language": "Gunakan bahasa sistem", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "Airdrop", diff --git a/public/locales/ja/settings.json b/public/locales/ja/settings.json index 496bc3c5b..c3f904e13 100644 --- a/public/locales/ja/settings.json +++ b/public/locales/ja/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "招待コードを適用", "cancel": "キャンセル", "change-language": "言語", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Abandon current wallet?", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?", "connected-peers": "接続されたピア", @@ -83,6 +85,11 @@ }, "pool-mining": "プールマイニング", "pool-mining-description": "有効にすると、プールでマイニングし、マイナーのグループに参加します。", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Randomxネットワークのハッシュレート", "refresh-versions": "バージョンを更新", "release-notes": { @@ -108,6 +115,7 @@ "title": "システム起動時に自動開始" }, "should-use-system-language": "システム言語を使用", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "エアドロップ", diff --git a/public/locales/ko/settings.json b/public/locales/ko/settings.json index 40da718af..581529585 100644 --- a/public/locales/ko/settings.json +++ b/public/locales/ko/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "초대 코드 적용", "cancel": "취소", "change-language": "언어", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Abandon current wallet?", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?", "connected-peers": "연결된 피어", @@ -83,6 +85,11 @@ }, "pool-mining": "풀 채굴", "pool-mining-description": "활성화되면 풀에서 채굴하고 마이너 그룹에 참여합니다.", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Randomx 네트워크 해시레이트", "refresh-versions": "버전 새로고침", "release-notes": { @@ -108,6 +115,7 @@ "title": "시스템 부팅 시 자동 시작" }, "should-use-system-language": "시스템 언어 사용", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "에어드롭", diff --git a/public/locales/pl/settings.json b/public/locales/pl/settings.json index ec5551010..acd0e61df 100644 --- a/public/locales/pl/settings.json +++ b/public/locales/pl/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "Zastosuj Kod Zaproszenia", "cancel": "Anuluj", "change-language": "Zmień język", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Abandon current wallet?", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?", "connected-peers": "Połączone węzły", @@ -85,6 +87,11 @@ }, "pool-mining": "Kopanie w puli", "pool-mining-description": "Po włączeniu tej opcji będziesz wydobywać w puli i dołączać do grupy górników (plemienia).", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Hashrate sieci Randomx", "refresh-versions": "Odśwież wersje", "release-notes": { @@ -110,6 +117,7 @@ "title": "Automatyczne uruchamianie przy starcie systemu" }, "should-use-system-language": "Użyj języka systemowego", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "Airdrop", diff --git a/public/locales/ru/settings.json b/public/locales/ru/settings.json index 779df8e4b..af84d7657 100644 --- a/public/locales/ru/settings.json +++ b/public/locales/ru/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "Применить код приглашения", "cancel": "Отмена", "change-language": "Язык", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Abandon current wallet?", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?", "connected-peers": "Подключенные узлы", @@ -83,6 +85,11 @@ }, "pool-mining": "Майнинг в пуле", "pool-mining-description": "При включении вы будете майнить в пуле и присоединитесь к группе майнеров.", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Хэшрейт сети Randomx", "refresh-versions": "Обновить версии", "release-notes": { @@ -108,6 +115,7 @@ "title": "Автозапуск при загрузке системы" }, "should-use-system-language": "Использовать системный язык", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "Эйрдроп", diff --git a/public/locales/tr/settings.json b/public/locales/tr/settings.json index c1ff96255..9200d6157 100644 --- a/public/locales/tr/settings.json +++ b/public/locales/tr/settings.json @@ -6,6 +6,8 @@ "applyInviteCode": "Davet Kodunu Uygula", "cancel": "İptal", "change-language": "Dil Değiştir", + "confirm": "Confirm", + "confirm-action": "Confirm action", "confirm-import-wallet": "Abandon current wallet?", "confirm-import-wallet-copy": "Are you sure you want to import a new wallet?", "connected-peers": "Bağlı Eşler", @@ -83,6 +85,11 @@ }, "pool-mining": "Havuz Madenciliği", "pool-mining-description": "Etkinleştirildiğinde, bir havuzda madencilik yapacak ve bir grup madenciye (kabileye) katılacaksınız.", + "pre-release": { + "description": "Explore the latest features before they go live and provide feedback", + "title": "Use pre-release version" + }, + "pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.", "randomx-network-hash-rate": "Randomx ağ hash oranı", "refresh-versions": "Sürümleri yenileyin", "release-notes": { @@ -108,6 +115,7 @@ "title": "Sistem açılışında otomatik başlat" }, "should-use-system-language": "Sistem Dilini Kullan", + "stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.", "stats-server-port": "Stats server port", "tabs": { "airdrop": "Airdrop", diff --git a/src-tauri/src/app_config.rs b/src-tauri/src/app_config.rs index 8ca20cde9..582d11672 100644 --- a/src-tauri/src/app_config.rs +++ b/src-tauri/src/app_config.rs @@ -110,6 +110,8 @@ pub struct AppConfigFromFile { show_experimental_settings: bool, #[serde(default = "default_p2pool_stats_server_port")] p2pool_stats_server_port: Option, + #[serde(default = "default_false")] + pre_release: bool, } impl Default for AppConfigFromFile { @@ -151,6 +153,7 @@ impl Default for AppConfigFromFile { window_settings: default_window_settings(), show_experimental_settings: false, p2pool_stats_server_port: default_p2pool_stats_server_port(), + pre_release: false, } } } @@ -263,6 +266,7 @@ pub(crate) struct AppConfig { window_settings: Option, show_experimental_settings: bool, p2pool_stats_server_port: Option, + pre_release: bool, } impl AppConfig { @@ -307,6 +311,7 @@ impl AppConfig { show_experimental_settings: false, keyring_accessed: false, p2pool_stats_server_port: default_p2pool_stats_server_port(), + pre_release: false, } } @@ -383,6 +388,7 @@ impl AppConfig { self.window_settings = config.window_settings; self.show_experimental_settings = config.show_experimental_settings; self.p2pool_stats_server_port = config.p2pool_stats_server_port; + self.pre_release = config.pre_release; KEYRING_ACCESSED.store( config.keyring_accessed, @@ -694,6 +700,10 @@ impl AppConfig { Ok(()) } + pub fn auto_update(&self) -> bool { + self.auto_update + } + pub async fn set_auto_update(&mut self, auto_update: bool) -> Result<(), anyhow::Error> { self.auto_update = auto_update; self.update_config_file().await?; @@ -724,6 +734,16 @@ impl AppConfig { Ok(()) } + pub fn pre_release(&self) -> bool { + self.pre_release + } + + pub async fn set_pre_release(&mut self, pre_release: bool) -> Result<(), anyhow::Error> { + self.pre_release = pre_release; + self.update_config_file().await?; + Ok(()) + } + // Allow needless update because in future there may be fields that are // missing #[allow(clippy::needless_update)] @@ -770,6 +790,7 @@ impl AppConfig { window_settings: self.window_settings.clone(), show_experimental_settings: self.show_experimental_settings, p2pool_stats_server_port: self.p2pool_stats_server_port, + pre_release: self.pre_release, }; let config = serde_json::to_string(config)?; debug!(target: LOG_TARGET, "Updating config file: {:?} {:?}", file, self.clone()); diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 290f262f9..fc3f05ed3 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -1618,3 +1618,91 @@ pub async fn update_applications( Ok(()) } + +#[tauri::command] +pub async fn set_pre_release( + app: tauri::AppHandle, + pre_release: bool, + state: tauri::State<'_, UniverseAppState>, +) -> Result<(), String> { + let timer = Instant::now(); + state + .config + .write() + .await + .set_pre_release(pre_release) + .await + .map_err(|e| e.to_string())?; + + info!(target: LOG_TARGET, "Pre-release set to {}, try_update called", pre_release); + + state + .updates_manager + .try_update(app.clone(), true, !pre_release) + .await + .map_err(|e| e.to_string())?; + + if timer.elapsed() > MAX_ACCEPTABLE_COMMAND_TIME { + warn!(target: LOG_TARGET, "set_pre_release took too long: {:?}", timer.elapsed()); + } + + Ok(()) +} + +#[tauri::command] +pub async fn check_for_updates( + app: tauri::AppHandle, + state: tauri::State<'_, UniverseAppState>, +) -> Result, String> { + let timer = Instant::now(); + + let update = state + .updates_manager + .check_for_update(app.clone(), false) + .await + .map_err(|e| e.to_string())?; + + if timer.elapsed() > MAX_ACCEPTABLE_COMMAND_TIME { + warn!(target: LOG_TARGET, "check_for_updates took too long: {:?}", timer.elapsed()); + } + + Ok(update.map(|u| u.version)) +} + +#[tauri::command] +pub async fn try_update( + force: Option, + app: tauri::AppHandle, + state: tauri::State<'_, UniverseAppState>, +) -> Result<(), String> { + let timer = Instant::now(); + + state + .updates_manager + .try_update(app.clone(), force.unwrap_or(false), false) + .await + .map_err(|e| e.to_string())?; + + if timer.elapsed() > MAX_ACCEPTABLE_COMMAND_TIME { + warn!(target: LOG_TARGET, "check_for_updates took too long: {:?}", timer.elapsed()); + } + + Ok(()) +} + +#[tauri::command] +pub async fn proceed_with_update( + app: tauri::AppHandle, + state: tauri::State<'_, UniverseAppState>, +) -> Result<(), String> { + let timer = Instant::now(); + state + .updates_manager + .proceed_with_update(app.clone()) + .await + .map_err(|e| e.to_string())?; + if timer.elapsed() > MAX_ACCEPTABLE_COMMAND_TIME { + warn!(target: LOG_TARGET, "proceed_with_update took too long: {:?}", timer.elapsed()); + } + Ok(()) +} diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index b922c5904..ba5596c56 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -30,6 +30,7 @@ use log::{debug, error, info, warn}; use p2pool::models::Connections; use std::fs::{create_dir_all, remove_dir_all, remove_file, File}; use tokio::sync::watch::{self}; +use updates_manager::UpdatesManager; use log4rs::config::RawConfig; use serde::Serialize; @@ -112,6 +113,7 @@ mod telemetry_manager; mod tests; mod tor_adapter; mod tor_manager; +mod updates_manager; mod user_listener; mod utils; mod wallet_adapter; @@ -178,6 +180,11 @@ async fn setup_inner( return Ok(()); } + state + .updates_manager + .init_periodic_updates(app.clone()) + .await?; + let data_dir = app .path() .app_local_data_dir() @@ -576,6 +583,7 @@ struct UniverseAppState { airdrop_access_token: Arc>>, p2pool_manager: P2poolManager, tor_manager: TorManager, + updates_manager: UpdatesManager, cached_p2pool_stats: Arc>>>, cached_p2pool_connections: Arc>>>, cached_wallet_details: Arc>>, @@ -644,6 +652,8 @@ fn main() { p2pool_manager.clone(), ); + let updates_manager = UpdatesManager::new(app_config.clone(), shutdown.to_signal()); + let feedback = Feedback::new(app_in_memory_config.clone(), app_config.clone()); let mm_proxy_manager = MmProxyManager::new(); @@ -670,6 +680,7 @@ fn main() { feedback: Arc::new(RwLock::new(feedback)), airdrop_access_token: Arc::new(RwLock::new(None)), tor_manager: TorManager::new(), + updates_manager, cached_p2pool_stats: Arc::new(RwLock::new(None)), cached_p2pool_connections: Arc::new(RwLock::new(None)), cached_wallet_details: Arc::new(RwLock::new(None)), @@ -883,7 +894,10 @@ fn main() { commands::get_p2pool_connections, commands::set_p2pool_stats_server_port, commands::get_used_p2pool_stats_server_port, - commands::get_network + commands::proceed_with_update, + commands::set_pre_release, + commands::check_for_updates, + commands::try_update, ]) .build(tauri::generate_context!()) .inspect_err( diff --git a/src-tauri/src/updates_manager.rs b/src-tauri/src/updates_manager.rs new file mode 100644 index 000000000..7b38e9f35 --- /dev/null +++ b/src-tauri/src/updates_manager.rs @@ -0,0 +1,221 @@ +// Copyright 2024. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +use std::sync::Arc; +use tokio::time; + +use anyhow::anyhow; +use log::{error, info, warn}; + +use serde::{Deserialize, Serialize}; +use tauri::{Emitter, Url}; +use tauri_plugin_updater::{Update, UpdaterExt}; +use tokio::sync::RwLock; + +use crate::app_config::AppConfig; +use tari_shutdown::ShutdownSignal; +use tokio::time::Duration; + +const LOG_TARGET: &str = "tari::universe::updates_manager"; + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct DownloadProgressPayload { + pub event_type: String, + pub downloaded: u64, + pub total: u64, +} + +impl DownloadProgressPayload { + pub fn new(downloaded: u64, total: u64) -> Self { + Self { + event_type: "download_progress".to_string(), + downloaded, + total, + } + } +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct AskForUpdatePayload { + pub event_type: String, + pub version: String, +} + +impl AskForUpdatePayload { + pub fn new(version: String) -> Self { + Self { + event_type: "ask_for_update".to_string(), + version, + } + } +} + +#[derive(Clone)] +pub struct UpdatesManager { + config: Arc>, + update: Arc>>, + app_shutdown: ShutdownSignal, +} + +impl UpdatesManager { + pub fn new(config: Arc>, app_shutdown: ShutdownSignal) -> Self { + Self { + config, + update: Arc::new(RwLock::new(None)), + app_shutdown, + } + } + + pub async fn init_periodic_updates(&self, app: tauri::AppHandle) -> Result<(), anyhow::Error> { + let app_clone = app.clone(); + let self_clone = self.clone(); + tauri::async_runtime::spawn(async move { + let mut interval = time::interval(Duration::from_secs(3600)); + loop { + if self_clone.app_shutdown.is_triggered() && self_clone.app_shutdown.is_triggered() + { + break; + }; + interval.tick().await; + if let Err(e) = self_clone.try_update(app_clone.clone(), false, false).await { + error!(target: LOG_TARGET, "Error checking for updates: {:?}", e); + } + } + }); + + Ok(()) + } + + pub async fn try_update( + &self, + app: tauri::AppHandle, + force: bool, + enable_downgrade: bool, + ) -> Result<(), anyhow::Error> { + match self.check_for_update(app.clone(), enable_downgrade).await? { + Some(update) => { + let version = update.version.clone(); + info!(target: LOG_TARGET, "try_update: Update available: {:?}", version); + *self.update.write().await = Some(update); + let is_auto_update = self.config.read().await.auto_update(); + + if force { + info!(target: LOG_TARGET, "try_update: Proceeding with force update"); + self.proceed_with_update(app.clone()).await?; + } else if is_auto_update { + info!(target: LOG_TARGET, "try_update: Auto update is enabled. Proceeding with update"); + self.proceed_with_update(app.clone()).await?; + } else { + info!(target: LOG_TARGET, "try_update: Auto update is disabled. Prompting user to update"); + let payload = AskForUpdatePayload { + event_type: "ask_for_update".to_string(), + version, + }; + drop(app.emit("updates_event", payload).inspect_err(|e| { + warn!(target: LOG_TARGET, "Failed to emit 'updates-event' with UpdateAvailablePayload: {}", e); + })); + // proceed_with_update will be trigger by the user + } + } + None => { + info!(target: LOG_TARGET, "No updates available"); + } + } + + Ok(()) + } + + pub async fn check_for_update( + &self, + app: tauri::AppHandle, + enable_downgrade: bool, + ) -> Result, anyhow::Error> { + let is_pre_release = self.config.read().await.pre_release(); + let updates_url = self.get_updates_url(is_pre_release); + + let update = app + .updater_builder() + .version_comparator(move |current, update| { + if enable_downgrade { + // Needed for switching off the pre-release + update.version != current + } else { + update.version > current + } + }) + .endpoints(vec![updates_url]) + .expect("Failed to set update URL") + .build() + .expect("Failed to build updater") + .check() + .await + .expect("Failed to check for updates"); + + Ok(update) + } + + fn get_updates_url(&self, is_pre_release: bool) -> Url { + let updater_filename = if is_pre_release { + "alpha-latest" + } else { + "latest" + }; + + let update_url_string = format!("https://raw.githubusercontent.com/tari-project/universe/main/.updater/{updater_filename}.json"); + Url::parse(&update_url_string).expect("Failed to parse update URL") + } + + pub async fn proceed_with_update(&self, app: tauri::AppHandle) -> Result<(), anyhow::Error> { + let mut downloaded: u64 = 0; + let update = self + .update + .read() + .await + .clone() + .ok_or_else(|| anyhow!("No update available"))?; + + let mut last_emit = std::time::Instant::now(); + update + .download_and_install( + |chunk_length, content_length| { + downloaded += chunk_length as u64; + + let now = std::time::Instant::now(); + let is_last_chunk = content_length.map(|cl| downloaded >= cl).unwrap_or(false); + + if is_last_chunk || now.duration_since(last_emit) >= Duration::from_millis(100) { + last_emit = std::time::Instant::now(); + let payload = DownloadProgressPayload::new(downloaded, content_length.unwrap_or(downloaded)); + drop(app.emit("updates_event", payload).inspect_err(|e| { + warn!(target: LOG_TARGET, "Failed to emit 'updates_event' event: {}", e); + })); + } + }, + || { + app.restart(); + }, + ) + .await?; + + Ok(()) + } +} diff --git a/src/App/AppWrapper.tsx b/src/App/AppWrapper.tsx index 015ff18e2..90ca15271 100644 --- a/src/App/AppWrapper.tsx +++ b/src/App/AppWrapper.tsx @@ -4,14 +4,7 @@ import * as Sentry from '@sentry/react'; import { IGNORE_FETCHING } from '@app/App/sentryIgnore'; import { initSystray } from '@app/utils'; -import { - useCheckUpdate, - useDetectMode, - useDisableRefresh, - useInterval, - useLangaugeResolver, - useListenForExternalDependencies, -} from '@app/hooks'; +import { useDetectMode, useDisableRefresh, useLangaugeResolver, useListenForExternalDependencies } from '@app/hooks'; import packageInfo from '../../package.json'; import { useAppConfigStore } from '../store/useAppConfigStore.ts'; @@ -40,13 +33,10 @@ const sentryOptions = { setupLogger(); -const UPDATE_CHECK_INTERVAL = 1000 * 60 * 60; // 1 hour - export default function AppWrapper() { const allowTelemetry = useAppConfigStore((s) => s.allow_telemetry); const fetchAppConfig = useAppConfigStore((s) => s.fetchAppConfig); const setMiningNetwork = useMiningStore((s) => s.setMiningNetwork); - const checkUpdateTariUniverse = useCheckUpdate(); useDetectMode(); useDisableRefresh(); @@ -57,7 +47,6 @@ export default function AppWrapper() { useEffect(() => { async function initialize() { await fetchAppConfig(); - checkUpdateTariUniverse(); // first check await initSystray(); await setMiningNetwork(); } @@ -73,7 +62,5 @@ export default function AppWrapper() { } }, [allowTelemetry]); - useInterval(() => checkUpdateTariUniverse(), UPDATE_CHECK_INTERVAL); - return ; } diff --git a/src/components/dialogs/ConfirmationDialog.tsx b/src/components/dialogs/ConfirmationDialog.tsx new file mode 100644 index 000000000..382bddad6 --- /dev/null +++ b/src/components/dialogs/ConfirmationDialog.tsx @@ -0,0 +1,62 @@ +import { useTranslation } from 'react-i18next'; +import { Dialog, DialogContent } from '@app/components/elements/dialog/Dialog.tsx'; +import { Stack } from '@app/components/elements/Stack.tsx'; +import { Typography } from '@app/components/elements/Typography.tsx'; +import { Button } from '@app/components/elements/buttons/Button.tsx'; + +import { IoClose } from 'react-icons/io5'; +import { Divider } from '@app/components/elements/Divider.tsx'; +import { TextButton } from '@app/components/elements/buttons/TextButton.tsx'; +import { IconButton } from '@app/components/elements/buttons/IconButton.tsx'; +import { useTheme } from 'styled-components'; + +interface ConfirmationDialogProps { + title?: string; + description: string; + onConfirm: () => void; + onCancel: () => void; +} + +export default function ConfirmationDialog({ + title = 'confirm-action', + description, + onConfirm, + onCancel, +}: ConfirmationDialogProps) { + const { t } = useTranslation('settings', { useSuspense: false }); + const theme = useTheme(); + + return ( + + + + + {t(title)} + + + + + + + + {t(description)} + + + + + + {t('cancel')} + + + + + + + ); +} diff --git a/src/containers/floating/AutoUpdateDialog/AutoUpdateDialog.tsx b/src/containers/floating/AutoUpdateDialog/AutoUpdateDialog.tsx index 0188ba249..fcf0c723b 100644 --- a/src/containers/floating/AutoUpdateDialog/AutoUpdateDialog.tsx +++ b/src/containers/floating/AutoUpdateDialog/AutoUpdateDialog.tsx @@ -1,7 +1,6 @@ import { useTranslation } from 'react-i18next'; import { useUIStore } from '@app/store/useUIStore'; -import { useHandleUpdate } from '@app/hooks'; import { DialogContent, Dialog } from '@app/components/elements/dialog/Dialog'; import { SquaredButton } from '@app/components/elements/buttons/SquaredButton'; @@ -9,41 +8,85 @@ import { Typography } from '@app/components/elements/Typography'; import { UpdatedStatus } from './UpdatedStatus'; import { ButtonsWrapper } from './AutoUpdateDialog.styles'; -import { useEffect, useRef } from 'react'; +import { useCallback, useEffect, useState } from 'react'; +import { listen } from '@tauri-apps/api/event'; +import { invoke } from '@tauri-apps/api/core'; + +interface DownloadProgressPayload { + event_type: 'download_progress'; + downloaded: number; + total: number; +} + +interface AskForUpdatePayload { + event_type: 'ask_for_update'; + version: string; +} export default function AutoUpdateDialog() { - const hasFetched = useRef(false); - const { handleUpdate, fetchUpdate, updateData, isLoading, contentLength, downloaded, handleClose } = - useHandleUpdate(); const { t } = useTranslation('setup-view', { useSuspense: false }); - const open = useUIStore((s) => s.dialogToShow === 'autoUpdate'); + const setDialogToShow = useUIStore((s) => s.setDialogToShow); + const [version, setVersion] = useState(''); + const [downloaded, setDownloaded] = useState(0); + const [contentLength, setContentLength] = useState(0); + + const isDownloading = downloaded > 0; + const isDownloaded = isDownloading && downloaded === contentLength; + const subtitle = isDownloading ? 'installing-latest-version' : 'would-you-like-to-install'; useEffect(() => { - if (hasFetched.current) return; - fetchUpdate().then(() => { - hasFetched.current = true; - }); - }, [fetchUpdate]); + const unlistenPromise = listen( + 'updates_event', + ({ payload }: { payload: AskForUpdatePayload | DownloadProgressPayload }) => { + switch (payload.event_type) { + case 'ask_for_update': + setDialogToShow('autoUpdate'); + setVersion(payload.version); + break; + case 'download_progress': + if (!open) { + // open when auto update is triggered + setDialogToShow('autoUpdate'); + } + setDownloaded(payload.downloaded); + setContentLength(payload.total); + break; + default: + console.warn('Unknown tauri event: ', payload); + break; + } + } + ); + return () => { + unlistenPromise.then((unlisten) => unlisten()); + }; + }, [open, setDialogToShow]); + + const handleClose = useCallback(() => { + console.info('Update declined'); + setDialogToShow(null); + }, [setDialogToShow]); + + const handleUpdate = useCallback(() => { + console.info('Proceed with update'); + invoke('proceed_with_update').catch((e) => console.error('Failed to proceed with update', e)); + }, []); - const subtitle = isLoading ? 'installing-latest-version' : 'would-you-like-to-install'; return ( {t('new-tari-version-available')} - {t(subtitle, { version: updateData?.version })} - {isLoading && } - - {downloaded > 0 && downloaded === contentLength ? ( - {`Update downloaded: Restarting Tari Universe`} - ) : null} + {t(subtitle, { version })} + {isDownloading && } + {isDownloaded && {`Update downloaded: Restarting Tari Universe`}} - {!isLoading && updateData && ( + {!isDownloading && ( <> - handleClose()} color="warning"> + {t('no')} - handleUpdate()} color="green"> + {t('yes')} diff --git a/src/containers/floating/Settings/sections/general/GeneralSettings.tsx b/src/containers/floating/Settings/sections/general/GeneralSettings.tsx index aa123ec43..03b853d77 100644 --- a/src/containers/floating/Settings/sections/general/GeneralSettings.tsx +++ b/src/containers/floating/Settings/sections/general/GeneralSettings.tsx @@ -7,12 +7,14 @@ import LanguageSettings from './LanguageSettings.tsx'; import { ResetSettingsButton } from './ResetSettingsButton.tsx'; import StartApplicationOnBootSettings from './StartApplicationOnBootSettings.tsx'; import AutoUpdate from './AutoUpdate.tsx'; +import PreReleaseSettings from './PreReleaseSettings.tsx'; export const GeneralSettings = () => { return ( <> + diff --git a/src/containers/floating/Settings/sections/general/PreReleaseSettings.tsx b/src/containers/floating/Settings/sections/general/PreReleaseSettings.tsx new file mode 100644 index 000000000..05bf85324 --- /dev/null +++ b/src/containers/floating/Settings/sections/general/PreReleaseSettings.tsx @@ -0,0 +1,57 @@ +import { useTranslation } from 'react-i18next'; +import { ToggleSwitch } from '@app/components/elements/ToggleSwitch'; +import { useAppConfigStore } from '@app/store/useAppConfigStore'; +import { useCallback, useState } from 'react'; +import { Typography } from '@app/components/elements/Typography.tsx'; +import { + SettingsGroupWrapper, + SettingsGroup, + SettingsGroupContent, + SettingsGroupTitle, + SettingsGroupAction, +} from '../../components/SettingsGroup.styles'; +import ConfirmationDialog from '@app/components/dialogs/ConfirmationDialog'; + +export default function PreReleaseSettings() { + const isPreRelease = useAppConfigStore((s) => s.pre_release); + const setPreRelease = useAppConfigStore((s) => s.setPreRelease); + const { t } = useTranslation('settings', { useSuspense: false }); + const [isDialogOpen, setDialogOpen] = useState(false); + + const closeDialog = useCallback(() => { + setDialogOpen(false); + }, [setDialogOpen]); + + const askForConfirmation = useCallback(() => { + setDialogOpen(true); + }, [setDialogOpen]); + + const applyChange = useCallback(() => { + closeDialog(); + setPreRelease(!isPreRelease); + }, [closeDialog, isPreRelease, setPreRelease]); + + return ( + + + + + {t('pre-release.title')} + + {t('pre-release.description')} + + + + + + + {isDialogOpen && ( + + )} + + ); +} diff --git a/src/containers/floating/Settings/sections/releaseNotes/ReleaseNotes.tsx b/src/containers/floating/Settings/sections/releaseNotes/ReleaseNotes.tsx index 47c8488a9..387bc79b8 100644 --- a/src/containers/floating/Settings/sections/releaseNotes/ReleaseNotes.tsx +++ b/src/containers/floating/Settings/sections/releaseNotes/ReleaseNotes.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import ReactMarkdown from 'react-markdown'; import { IconImage, @@ -15,8 +15,7 @@ import { AccordionItem } from './AccordionItem/AccordionItem'; import tariIcon from './tari-icon.png'; import packageInfo from '../../../../../../package.json'; import { useTranslation } from 'react-i18next'; -import { useUIStore } from '@app/store/useUIStore'; -import { check } from '@tauri-apps/plugin-updater'; +import { invoke } from '@tauri-apps/api/core'; const appVersion = packageInfo.version; const versionString = `v${appVersion}`; @@ -46,7 +45,6 @@ interface ReleaseSection { } export const ReleaseNotes = () => { - const { setDialogToShow } = useUIStore(); const [sections, setSections] = useState([]); const [isLoading, setIsLoading] = useState(true); const [openSectionIndex, setOpenSectionIndex] = useState(0); @@ -77,9 +75,10 @@ export const ReleaseNotes = () => { useEffect(() => { const checkForUpdates = async () => { - const update = await check(); - const shouldUpdate = !!update?.available; - setNeedsUpgrade(shouldUpdate); + const version = await invoke('check_for_updates').catch((err) => { + console.error('Error checking for updates:', err); + }); + setNeedsUpgrade(!!version); }; checkForUpdates(); @@ -89,6 +88,12 @@ export const ReleaseNotes = () => { setOpenSectionIndex(openSectionIndex === index ? null : index); }; + const handleUpdate = useCallback(async () => { + invoke('proceed_with_update', { force: true }).catch((err) => { + console.error('Error updating:', err); + }); + }, []); + return ( @@ -101,7 +106,7 @@ export const ReleaseNotes = () => { {needsUpgrade && !isLoading && ( - setDialogToShow('autoUpdate')}> + {t('settings:release-notes.upgrade-available')} )} diff --git a/src/hooks/app/index.ts b/src/hooks/app/index.ts index c1549a44c..1af1019ab 100644 --- a/src/hooks/app/index.ts +++ b/src/hooks/app/index.ts @@ -6,4 +6,3 @@ export * from './useListenForExternalDependencies.ts'; export * from './useSetUp.ts'; export * from './useShuttingDown.ts'; export * from './useSystemTray.ts'; -export * from './useUpdateStatus.ts'; diff --git a/src/hooks/app/useSetUp.ts b/src/hooks/app/useSetUp.ts index c52aca6cf..cbda61289 100644 --- a/src/hooks/app/useSetUp.ts +++ b/src/hooks/app/useSetUp.ts @@ -16,7 +16,6 @@ export function useSetUp() { const adminShow = useUIStore((s) => s.adminShow); const setSetupDetails = useAppStateStore((s) => s.setSetupDetails); const setCriticalError = useAppStateStore((s) => s.setCriticalError); - const isAfterAutoUpdate = useAppStateStore((s) => s.isAfterAutoUpdate); const setSettingUpFinished = useAppStateStore((s) => s.setSettingUpFinished); const fetchApplicationsVersionsWithRetry = useAppStateStore((s) => s.fetchApplicationsVersionsWithRetry); @@ -65,7 +64,7 @@ export function useSetUp() { break; } }); - if (isAfterAutoUpdate && syncedAidropWithBackend && !isInitializingRef.current) { + if (syncedAidropWithBackend && !isInitializingRef.current) { isInitializingRef.current = true; clearStorage(); invoke('setup_application').catch((e) => { @@ -76,13 +75,5 @@ export function useSetUp() { return () => { unlistenPromise.then((unlisten) => unlisten()); }; - }, [ - clearStorage, - handlePostSetup, - isAfterAutoUpdate, - setCriticalError, - setSetupDetails, - adminShow, - syncedAidropWithBackend, - ]); + }, [clearStorage, handlePostSetup, setCriticalError, setSetupDetails, adminShow, syncedAidropWithBackend]); } diff --git a/src/hooks/app/useUpdateStatus.ts b/src/hooks/app/useUpdateStatus.ts deleted file mode 100644 index af53e6811..000000000 --- a/src/hooks/app/useUpdateStatus.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { useCallback, useState } from 'react'; -import { check, Update } from '@tauri-apps/plugin-updater'; -import { relaunch } from '@tauri-apps/plugin-process'; - -import { useAppStateStore } from '@app/store/appStateStore'; -import { useAppConfigStore } from '@app/store/useAppConfigStore'; -import { useUIStore } from '@app/store/useUIStore'; - -export const useHandleUpdate = () => { - const setIsAfterAutoUpdate = useAppStateStore((s) => s.setIsAfterAutoUpdate); - const setError = useAppStateStore((s) => s.setError); - const auto_update = useAppConfigStore((s) => s.auto_update); - const [updateData, setUpdateData] = useState(); - const [isLoading, setIsLoading] = useState(false); - const [contentLength, setContentLength] = useState(0); - const [downloaded, setDownloaded] = useState(0); - const setDialogToShow = useUIStore((s) => s.setDialogToShow); - - const handleClose = useCallback(() => { - setDialogToShow(null); - setIsAfterAutoUpdate(true); - }, [setIsAfterAutoUpdate, setDialogToShow]); - - const handleUpdate = useCallback(async () => { - if (!updateData) return; - setIsLoading(true); - console.info('Installing latest version of Tari Universe'); - - updateData - .downloadAndInstall(async (event) => { - switch (event.event) { - case 'Started': - setContentLength(event.data.contentLength || 0); - break; - case 'Progress': - setDownloaded((c) => c + event.data.chunkLength); - break; - case 'Finished': - console.info('download finished'); - break; - } - }) - .then(async () => { - handleClose(); - await relaunch(); - }) - .catch((e) => { - console.error(e); - setError(e); - }); - }, [handleClose, setError, updateData]); - - const fetchUpdate = useCallback(async () => { - const update = await check(); - if (update) { - setUpdateData(update); - - if (auto_update) { - await handleUpdate(); - } - } - }, [auto_update, handleUpdate]); - - return { - fetchUpdate, - handleUpdate, - updateData, - isLoading, - contentLength, - handleClose, - downloaded, - }; -}; - -export const useCheckUpdate = () => { - const setIsAfterAutoUpdate = useAppStateStore((s) => s.setIsAfterAutoUpdate); - const setDialogToShow = useUIStore((s) => s.setDialogToShow); - - return useCallback(() => { - check() - .then((updateRes) => { - if (updateRes && updateRes.available) { - setDialogToShow('autoUpdate'); - } else { - setIsAfterAutoUpdate(true); - } - }) - .catch(() => setIsAfterAutoUpdate(true)); - }, [setDialogToShow, setIsAfterAutoUpdate]); -}; diff --git a/src/store/appStateStore.ts b/src/store/appStateStore.ts index 1f5869cf2..47065e268 100644 --- a/src/store/appStateStore.ts +++ b/src/store/appStateStore.ts @@ -7,8 +7,6 @@ import { useMiningStore } from './useMiningStore'; import { addToast } from '@app/components/ToastStack/useToastStore'; interface AppState { - isAfterAutoUpdate: boolean; - setIsAfterAutoUpdate: (value: boolean) => void; criticalError?: string; setCriticalError: (value: string | undefined) => void; error?: string; @@ -38,8 +36,6 @@ interface AppState { } export const useAppStateStore = create()((set, getState) => ({ - isAfterAutoUpdate: false, - setIsAfterAutoUpdate: (value: boolean) => set({ isAfterAutoUpdate: value }), criticalError: undefined, setCriticalError: (criticalError) => set({ criticalError }), error: undefined, diff --git a/src/store/useAppConfigStore.ts b/src/store/useAppConfigStore.ts index ece45bcec..adeefed24 100644 --- a/src/store/useAppConfigStore.ts +++ b/src/store/useAppConfigStore.ts @@ -34,6 +34,7 @@ interface Actions { setVisualMode: (enabled: boolean) => void; setShowExperimentalSettings: (showExperimentalSettings: boolean) => Promise; setP2poolStatsServerPort: (port: number | null) => Promise; + setPreRelease: (preRelease: boolean) => Promise; } type AppConfigStoreState = State & Actions; @@ -63,6 +64,7 @@ const initialState: State = { custom_max_gpu_usage: [], show_experimental_settings: false, p2pool_stats_server_port: null, + pre_release: false, }; export const useAppConfigStore = create()((set, getState) => ({ @@ -301,4 +303,13 @@ export const useAppConfigStore = create()((set, getState) = set({ p2pool_stats_server_port: port }); }); }, + setPreRelease: async (preRelease) => { + set({ pre_release: preRelease }); + invoke('set_pre_release', { preRelease }).catch((e) => { + const appStateStore = useAppStateStore.getState(); + console.error('Could not set pre release', e); + appStateStore.setError('Could not change pre release'); + set({ pre_release: !preRelease }); + }); + }, })); diff --git a/src/types/app-status.ts b/src/types/app-status.ts index e6f336e78..84737ed6d 100644 --- a/src/types/app-status.ts +++ b/src/types/app-status.ts @@ -47,6 +47,7 @@ export interface AppConfig { monero_address_is_generated?: boolean; created_at: string; p2pool_stats_server_port: number | null; + pre_release: boolean; } export enum ExternalDependencyStatus { diff --git a/src/types/invoke.ts b/src/types/invoke.ts index d191f663b..4f3041cb4 100644 --- a/src/types/invoke.ts +++ b/src/types/invoke.ts @@ -72,6 +72,10 @@ declare module '@tauri-apps/api/core' { function invoke(param: 'fetch_tor_bridges'): Promise; function invoke(param: 'get_tor_entry_guards'): Promise; function invoke(param: 'set_visual_mode', payload: { enabled: boolean }): Promise; + function invoke(param: 'set_pre_release', payload: { preRelease: boolean }): Promise; + function invoke(param: 'proceed_with_update'): Promise; + function invoke(param: 'check_for_updates'): Promise; + function invoke(param: 'try_update', payload?: { force?: boolean }): Promise; function invoke( param: 'set_show_experimental_settings', payload: { showExperimentalSettings: boolean } From 1e64743df6acf152a84c72a6b0acfd68e0b206f3 Mon Sep 17 00:00:00 2001 From: brianp Date: Tue, 10 Dec 2024 23:41:18 +0100 Subject: [PATCH 5/7] chore: version bump 0.8.10 --- package-lock.json | 4 ++-- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index a4c66ceb5..853bbf9cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tari-universe", - "version": "0.8.9", + "version": "0.8.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tari-universe", - "version": "0.8.9", + "version": "0.8.10", "dependencies": { "@floating-ui/react": "^0.26.28", "@lottiefiles/dotlottie-react": "^0.10.1", diff --git a/package.json b/package.json index e56635f75..04b2441b9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tari-universe", "private": true, - "version": "0.8.9", + "version": "0.8.10", "type": "module", "scripts": { "dev": "vite dev --mode development", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index f533f1303..b5ae2df12 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -6740,7 +6740,7 @@ dependencies = [ [[package]] name = "tari-universe" -version = "0.8.9" +version = "0.8.10" dependencies = [ "anyhow", "async-trait", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 22ea1f3fa..4e5ee513d 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -4,7 +4,7 @@ description = "Tari Universe" edition = "2021" name = "tari-universe" repository = "https://github.com/tari-project/universe" -version = "0.8.9" +version = "0.8.10" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6375a5a7a..bd62c0a33 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "version": "0.8.9", + "version": "0.8.10", "productName": "Tari Universe (Alpha)", "mainBinaryName": "Tari Universe (Alpha)", "identifier": "com.tari.universe.alpha", From 8065ad2ed2ec8ecbd5d6c54847c32d3c7e11cdfc Mon Sep 17 00:00:00 2001 From: stringhandler Date: Wed, 11 Dec 2024 08:57:04 +0200 Subject: [PATCH 6/7] chore: autoupdate 0.8.9 --- .updater/latest.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.updater/latest.json b/.updater/latest.json index 4bf6138f7..e4e5fa8b8 100644 --- a/.updater/latest.json +++ b/.updater/latest.json @@ -1,23 +1,23 @@ { - "version": "0.8.7", + "version": "0.8.9", "notes": "Tari Universe - See the assets to download this version and install", - "pub_date": "2024-12-05T17:16:20.900Z", + "pub_date": "2024-12-10T11:19:32.841Z", "platforms": { "linux-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFcrRnF2NFYxZk1INmJrK25WMjFGbGZHdGdqNmUzdWcrOXRBekFTYXFzK3UrSVptcW1FWG00T3JUZnE4T1FqUjVIU1pLRXVWRVI2VXFUamkvOWpPb0FRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE2NjQzCWZpbGU6dGFyaS11bml2ZXJzZV8wLjguN19hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKNHJ5dzgvcHdMTjRGbVRGYlZyY01yZ0U2dnZCM3VRTEtuUlBpR3pBa0R1ZkpoN2NEbU5SZGRLKy8reXhEY3ZnZUVDYWZIQlE5MHRQbUFPcEsySW5PREE9PQo=", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/tari-universe_0.8.7_amd64.AppImage.tar.gz" - }, - "windows-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGU0b0lRSUI2MDdQWVB6T1dtbzJqVVRra3BkaVY1NGNaQ0NKVHgwdkpybGcySmpwRXdRbkNhTHRFRFVhZmVBM2d2ZVdOWkNTYkh2Qi90KytwWFMzT2c4PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE3NzMzCWZpbGU6VGFyaSBVbml2ZXJzZV8wLjguN194NjRfZW4tVVMubXNpLnppcApCOUlsZnZ4clA4SlJEYXJabk91MExTbHhBUW9mc2JrNFNOTzJZaVo1VHdhQjRqL0dKaWIyTnFmNFE5NmtGRncwWmpiUEJPZ1lNUi9xN1Y5ZHVoYVNEdz09Cg==", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_0.8.7_x64_en-US.msi.zip" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFlhQzZTS2ZOSHZRczVtUExVS2ZvQUU1VWU2S0pqVktSTWNrTkhHd0hNRGZ1NGdHUUgyS082TkFsQldjeEdBUDByTE1FMElESm1VZzdiWmZqcGVYcmc4PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI4ODA0CWZpbGU6dGFyaS11bml2ZXJzZV8wLjguOV9hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKZmhNV09nWlNjamN6bk12Z0V2RUpMZ2VXNmVyYlo3Yk4zMzFZYjEwUUY4MkFuaUxkYjVhUzU5QXJlbndIdS9LZWkrQ1FnS3ROMzgwazk2RXJnb3Y3Q1E9PQo=", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/tari-universe_0.8.9_amd64.AppImage.tar.gz" }, "darwin-aarch64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGVBSGtCQWlybHR4TVdVNThNS0Y1MFNSWDlkZE1TNk9YVkhZV2F1dVZEQWtZenlOM0xBaVVsWjJWZ0MzOUZjMzNrV1krY2k3OTBKeWZrdVQ1L3ZXUWdRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE4OTY0CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CitDT0o5UXJpTWpPQVBDVzI1amVaOUQwZGNveEtjTy8wMlp3dnFxWGZMWWF2bWdPelBrR2pJRy90Q0MvdTNqM29ydkN4R0VHaTMxQW1maVVPRU5CQURRPT0K", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_universal.app.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGZsVU1vaHpWUXR0eVJDcmVqZ2JNbC9xdGRlVU9LUlJHYmNSWk1oQU9KYXpoUVFhWWRMdXpENFZJVVRQRmFlaDFkWkluUnZDU2hwbWswMFhVOWJHNGdjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5Mzg4CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CjlLTzB6TEcwSm1GaU5pWGV1VWIxRTRTTFlXaVdHY1lmR3UzQ05IRDRGT2x0TXFqd2FsYmI2TGZiVnh1cFFlSHJPVDZ3bjN5SDh2QkNhUW1PSElrMkNnPT0K", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_universal.app.tar.gz" }, "darwin-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGVBSGtCQWlybHR4TVdVNThNS0Y1MFNSWDlkZE1TNk9YVkhZV2F1dVZEQWtZenlOM0xBaVVsWjJWZ0MzOUZjMzNrV1krY2k3OTBKeWZrdVQ1L3ZXUWdRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE4OTY0CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CitDT0o5UXJpTWpPQVBDVzI1amVaOUQwZGNveEtjTy8wMlp3dnFxWGZMWWF2bWdPelBrR2pJRy90Q0MvdTNqM29ydkN4R0VHaTMxQW1maVVPRU5CQURRPT0K", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_universal.app.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGZsVU1vaHpWUXR0eVJDcmVqZ2JNbC9xdGRlVU9LUlJHYmNSWk1oQU9KYXpoUVFhWWRMdXpENFZJVVRQRmFlaDFkWkluUnZDU2hwbWswMFhVOWJHNGdjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5Mzg4CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CjlLTzB6TEcwSm1GaU5pWGV1VWIxRTRTTFlXaVdHY1lmR3UzQ05IRDRGT2x0TXFqd2FsYmI2TGZiVnh1cFFlSHJPVDZ3bjN5SDh2QkNhUW1PSElrMkNnPT0K", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_universal.app.tar.gz" + }, + "windows-x86_64": { + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFdIeFFZRGxxT3NYbHQwb0tUU2lzbmRSdGcyWmpIcnBzMHpYcnJWSkdWcnJKYlJ4VnlwemNBOUh3NStqU3o0cXNMdS9IaE5uQ3Z2SGczM2NlMXhDVHdFPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5NTY2CWZpbGU6VGFyaSBVbml2ZXJzZV8wLjguOV94NjRfZW4tVVMubXNpLnppcApTUGxYMFdNOHdpZGhNOVluNktHd2M3QXl2VlpVQTVSNGpKUU9vN29LTEVCQUVtdXE0cjc0akU3cTZLbS91OUovZXVVcDlXSllROFJkbHcrdHVWZkhEdz09Cg==", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_0.8.9_x64_en-US.msi.zip" } } } \ No newline at end of file From 2e36bcf313de216cc5ded3354f67864afa570bf8 Mon Sep 17 00:00:00 2001 From: stringhandler Date: Wed, 11 Dec 2024 09:19:47 +0200 Subject: [PATCH 7/7] chore: pause autoupdate 0.8.9 --- .updater/latest.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.updater/latest.json b/.updater/latest.json index e4e5fa8b8..4bf6138f7 100644 --- a/.updater/latest.json +++ b/.updater/latest.json @@ -1,23 +1,23 @@ { - "version": "0.8.9", + "version": "0.8.7", "notes": "Tari Universe - See the assets to download this version and install", - "pub_date": "2024-12-10T11:19:32.841Z", + "pub_date": "2024-12-05T17:16:20.900Z", "platforms": { "linux-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFlhQzZTS2ZOSHZRczVtUExVS2ZvQUU1VWU2S0pqVktSTWNrTkhHd0hNRGZ1NGdHUUgyS082TkFsQldjeEdBUDByTE1FMElESm1VZzdiWmZqcGVYcmc4PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI4ODA0CWZpbGU6dGFyaS11bml2ZXJzZV8wLjguOV9hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKZmhNV09nWlNjamN6bk12Z0V2RUpMZ2VXNmVyYlo3Yk4zMzFZYjEwUUY4MkFuaUxkYjVhUzU5QXJlbndIdS9LZWkrQ1FnS3ROMzgwazk2RXJnb3Y3Q1E9PQo=", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/tari-universe_0.8.9_amd64.AppImage.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFcrRnF2NFYxZk1INmJrK25WMjFGbGZHdGdqNmUzdWcrOXRBekFTYXFzK3UrSVptcW1FWG00T3JUZnE4T1FqUjVIU1pLRXVWRVI2VXFUamkvOWpPb0FRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE2NjQzCWZpbGU6dGFyaS11bml2ZXJzZV8wLjguN19hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKNHJ5dzgvcHdMTjRGbVRGYlZyY01yZ0U2dnZCM3VRTEtuUlBpR3pBa0R1ZkpoN2NEbU5SZGRLKy8reXhEY3ZnZUVDYWZIQlE5MHRQbUFPcEsySW5PREE9PQo=", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/tari-universe_0.8.7_amd64.AppImage.tar.gz" + }, + "windows-x86_64": { + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGU0b0lRSUI2MDdQWVB6T1dtbzJqVVRra3BkaVY1NGNaQ0NKVHgwdkpybGcySmpwRXdRbkNhTHRFRFVhZmVBM2d2ZVdOWkNTYkh2Qi90KytwWFMzT2c4PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE3NzMzCWZpbGU6VGFyaSBVbml2ZXJzZV8wLjguN194NjRfZW4tVVMubXNpLnppcApCOUlsZnZ4clA4SlJEYXJabk91MExTbHhBUW9mc2JrNFNOTzJZaVo1VHdhQjRqL0dKaWIyTnFmNFE5NmtGRncwWmpiUEJPZ1lNUi9xN1Y5ZHVoYVNEdz09Cg==", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_0.8.7_x64_en-US.msi.zip" }, "darwin-aarch64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGZsVU1vaHpWUXR0eVJDcmVqZ2JNbC9xdGRlVU9LUlJHYmNSWk1oQU9KYXpoUVFhWWRMdXpENFZJVVRQRmFlaDFkWkluUnZDU2hwbWswMFhVOWJHNGdjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5Mzg4CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CjlLTzB6TEcwSm1GaU5pWGV1VWIxRTRTTFlXaVdHY1lmR3UzQ05IRDRGT2x0TXFqd2FsYmI2TGZiVnh1cFFlSHJPVDZ3bjN5SDh2QkNhUW1PSElrMkNnPT0K", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_universal.app.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGVBSGtCQWlybHR4TVdVNThNS0Y1MFNSWDlkZE1TNk9YVkhZV2F1dVZEQWtZenlOM0xBaVVsWjJWZ0MzOUZjMzNrV1krY2k3OTBKeWZrdVQ1L3ZXUWdRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE4OTY0CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CitDT0o5UXJpTWpPQVBDVzI1amVaOUQwZGNveEtjTy8wMlp3dnFxWGZMWWF2bWdPelBrR2pJRy90Q0MvdTNqM29ydkN4R0VHaTMxQW1maVVPRU5CQURRPT0K", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_universal.app.tar.gz" }, "darwin-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGZsVU1vaHpWUXR0eVJDcmVqZ2JNbC9xdGRlVU9LUlJHYmNSWk1oQU9KYXpoUVFhWWRMdXpENFZJVVRQRmFlaDFkWkluUnZDU2hwbWswMFhVOWJHNGdjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5Mzg4CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CjlLTzB6TEcwSm1GaU5pWGV1VWIxRTRTTFlXaVdHY1lmR3UzQ05IRDRGT2x0TXFqd2FsYmI2TGZiVnh1cFFlSHJPVDZ3bjN5SDh2QkNhUW1PSElrMkNnPT0K", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_universal.app.tar.gz" - }, - "windows-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFdIeFFZRGxxT3NYbHQwb0tUU2lzbmRSdGcyWmpIcnBzMHpYcnJWSkdWcnJKYlJ4VnlwemNBOUh3NStqU3o0cXNMdS9IaE5uQ3Z2SGczM2NlMXhDVHdFPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzODI5NTY2CWZpbGU6VGFyaSBVbml2ZXJzZV8wLjguOV94NjRfZW4tVVMubXNpLnppcApTUGxYMFdNOHdpZGhNOVluNktHd2M3QXl2VlpVQTVSNGpKUU9vN29LTEVCQUVtdXE0cjc0akU3cTZLbS91OUovZXVVcDlXSllROFJkbHcrdHVWZkhEdz09Cg==", - "url": "https://github.com/tari-project/universe/releases/download/v0.8.9/Tari.Universe_0.8.9_x64_en-US.msi.zip" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGVBSGtCQWlybHR4TVdVNThNS0Y1MFNSWDlkZE1TNk9YVkhZV2F1dVZEQWtZenlOM0xBaVVsWjJWZ0MzOUZjMzNrV1krY2k3OTBKeWZrdVQ1L3ZXUWdRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMzNDE4OTY0CWZpbGU6VGFyaSBVbml2ZXJzZS5hcHAudGFyLmd6CitDT0o5UXJpTWpPQVBDVzI1amVaOUQwZGNveEtjTy8wMlp3dnFxWGZMWWF2bWdPelBrR2pJRy90Q0MvdTNqM29ydkN4R0VHaTMxQW1maVVPRU5CQURRPT0K", + "url": "https://github.com/tari-project/universe/releases/download/v0.8.7/Tari.Universe_universal.app.tar.gz" } } } \ No newline at end of file