Allow upgrade nag bar to be dismissed per session

#-4368:
"Users on third party builds may have to wait a few hours for the update and the bar is annoying."
This commit is contained in:
infiinte-persistence 2020-06-20 21:40:27 +08:00 committed by Sean Yesmunt
parent feb7fb8e05
commit 2f8af4e1fa
2 changed files with 13 additions and 1 deletions

View file

@ -1244,6 +1244,15 @@
"YB": "YB",
"Save": "Save",
"Saving...": "Saving...",
"Downloading Update": "Downloading Update",
"complete": "complete",
"Click \"Begin Upgrade\" to start the upgrade process.": "Click \"Begin Upgrade\" to start the upgrade process.",
"The app will close (if not, quit with CTRL-Q), and you will be prompted to install the latest version of LBRY.": "The app will close (if not, quit with CTRL-Q), and you will be prompted to install the latest version of LBRY.",
"To launch installation manually, close LBRY (CTRL-Q) and run the command below in the terminal.": "To launch installation manually, close LBRY (CTRL-Q) and run the command below in the terminal.",
"After the install is complete, please reopen the app.": "After the install is complete, please reopen the app.",
"Note: You can also install the AppImage version for streamlined updates.": "Note: You can also install the AppImage version for streamlined updates.",
"Download here.": "Download here.",
"Begin Upgrade": "Begin Upgrade",
"Thanks for the feedback! You help make the app better for everyone.": "Thanks for the feedback! You help make the app better for everyone.",
"Thanks for the feedback. Mark has been notified and is currently walking over to his computer to work on this.": "Thanks for the feedback. Mark has been notified and is currently walking over to his computer to work on this.",
"Changelog": "Changelog",

View file

@ -115,7 +115,9 @@ function App(props: Props) {
const [lbryTvApiStatus, setLbryTvApiStatus] = useState(STATUS_OK);
// @endif
const { pathname, hash, search } = props.location;
const showUpgradeButton = autoUpdateDownloaded || (process.platform === 'linux' && isUpgradeAvailable);
const [upgradeNagClosed, setUpgradeNagClosed] = useState(false);
const showUpgradeButton =
(autoUpdateDownloaded || (process.platform === 'linux' && isUpgradeAvailable)) && !upgradeNagClosed;
// referral claiming
const referredRewardAvailable = rewards && rewards.some(reward => reward.reward_type === REWARDS.TYPE_REFEREE);
const urlParams = new URLSearchParams(search);
@ -305,6 +307,7 @@ function App(props: Props) {
message={__('An upgrade is available.')}
actionText={__('Install Now')}
onClick={requestDownloadUpgrade}
onClose={() => setUpgradeNagClosed(true)}
/>
)}
{/* @endif */}