okteto / docker-desktop-extension

Docker Extension for Okteto
Apache License 2.0
5 stars 4 forks source link

Feature/display status issue 74 #76

Closed leomindez closed 1 year ago

leomindez commented 1 year ago

74

Add status command to listen the changes and display view to notify user

@rlamana

leomindez commented 1 year ago

@rlamana

I would like to know if that is the right way to implement the command. I was wondering how to add the listener to get the status value. Could you give me some clues about it?

rlamana commented 1 year ago

@leomindez For the listener part, the status command executes and dies, there is no watcher parameter or similar. We need to include some sort of polling to keep the status updated. You have an example of that when refreshing the current Okteto context here: https://github.com/okteto/docker-desktop-extension/blob/main/client/src/contexts/Okteto.context.tsx#L95

My suggestion is to call the API function you created from the contexts/Okteto.context.tsx file, just like with the example above. That should keep the state updated for the react component to consume, instead of calling the API directly from the component.

rlamana commented 1 year ago

Closing this PR in favor of https://github.com/okteto/docker-desktop-extension/pull/81