Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an Update button in the app's top-bar menu #1664

Closed
bfitzexpensify opened this issue Mar 8, 2021 · 7 comments · Fixed by #1766
Closed

Create an Update button in the app's top-bar menu #1664

bfitzexpensify opened this issue Mar 8, 2021 · 7 comments · Fixed by #1766

Comments

@bfitzexpensify
Copy link
Contributor

bfitzexpensify commented Mar 8, 2021

If you haven’t already, check out our contributing guidelines for onboarding!


Platform - version:
Web/Desktop - v1.0.1-454

Action Performed (reproducible steps):

  • In Add auto-update on hide workflow for Electron on Mac #1318 we updated the desktop update paradigm. When an update is available, a notification appears (as before). Except now, clicking on the notification opens the UpdateAppModal, which updates and restarts the app.
  • However, if the user has notifications disabled, they will never see the update notification and have no way to update the app

Expected Result:

  • We need users to be able to update, even if they have notifications disabled. On desktop, when an update is available, we need to create an Update button in app's top-bar menu — I.e. here:

image

https://www.upwork.com/jobs/~016781e062ce860b84

@shawnborton

This comment has been minimized.

@bfitzexpensify

This comment has been minimized.

@parasharrajat
Copy link
Member

parasharrajat commented Mar 8, 2021

Yeah, Correct. A mock-up would be good to submit a complete proposal. I was following it closing #1318 here. @nbhargava did a great job. As starting the Main concept would be as follows:

Proposal

  1. Create the button on the Settings page as per the mockups.
    To show the button when the update is available, we will listen to the following Onyx Key.
export default withOnyx({
    version: {
        key: ONYXKEYS.UPDATE_VERSION,
        initWithStoredValues: false,
    },
});

  1. On Press of the Button we have to send a message to the main Process using the
ipcRenderer.sendSync('start-update', props.version);

Which will start the Update process as it does for closing or submitting the UpdateAppModal.

Question:

Are you looking for the Web platform update as well? it's not clear from the Issue description.

@roryabraham
Copy link
Contributor

Are you looking for the Web platform update as well?

Nope, sorry for the confusion. This is desktop-only.

To show the button when the update is available, we will listen to the following Onyx Key

That actually won't work because that Onyx key is only set when the update notification is pressed here, but the whole point of adding the button in the settings menu is that it's possible to disable notifications entirely for the desktop client, and if you did that you would then have no way of updating it.

@parasharrajat
Copy link
Member

parasharrajat commented Mar 8, 2021

Ah sorry, Didn't see this part. So if this is the case. Then We can do is set the key on Onyx if the user has not given the notification permission. Something Like.

  pushUpdateAvailableNotification({version}) {
        push({
            title: 'Update available',
            body: 'A new version of Expensify.cash is available!',
            delay: 0,
            onClick: () => {
                Onyx.merge(ONYXKEYS.UPDATE_VERSION, version);
            },
        }).then(((notification) => {
        if(!notification){
        
        Onyx.merge(ONYXKEYS.UPDATE_VERSION, version);
        }
        });
    },

updating the push method according. or if throwing the error is not an option.

I see listening on the ipcRenderer.on('update-downloaded') ; would be a repetitive step. As we again need to check the user notification permission and then Set the Onyx Key.
Also, checking the user notification permission is important as the old Update procedure shows the UI based on Notification unless we want to touch that part.

@Shadows97
Copy link

In order to solve this problem it will be necessary to put in place the update button of the application and define its appearance on two conditions to know according to the platform and the availability of update. So once the update is available it will be displayed.

@bfitzexpensify bfitzexpensify changed the title Create an Update button on the settings page Create an Update button in the app's top-bar menu Mar 10, 2021
@bfitzexpensify
Copy link
Contributor Author

cc @nbhargava — ready to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants