Skip to content

Commit

Permalink
Merge pull request #5474 from rak-phillip/bugfix/5457-add-image-button
Browse files Browse the repository at this point in the history
Disable "Add Image" button when preferences change
  • Loading branch information
ericpromislow authored Sep 7, 2023
2 parents 9d8f2e3 + 2354837 commit f4c1fa1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/rancher-desktop/pages/Images.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ import Images from '@pkg/components/Images.vue';
import { defaultSettings } from '@pkg/config/settings';
import { ipcRenderer } from '@pkg/utils/ipcRenderer';
const ImageMangerStates = Object.freeze({
UNREADY: 'IMAGE_MANAGER_UNREADY',
READY: 'READY',
});
export default {
components: { Images },
data() {
Expand All @@ -40,10 +45,10 @@ export default {
computed: {
state() {
if (![K8sState.STARTED, K8sState.DISABLED].includes(this.k8sState)) {
return 'IMAGE_MANAGER_UNREADY';
return ImageMangerStates.UNREADY;
}
return this.imageManagerState ? 'READY' : 'IMAGE_MANAGER_UNREADY';
return this.imageManagerState ? ImageMangerStates.READY : ImageMangerStates.UNREADY;
},
rancherImages() {
return this.images
Expand All @@ -67,14 +72,14 @@ export default {
},
watch: {
imageManagerState: {
state: {
handler(state) {
this.$store.dispatch(
'page/setHeader',
{ title: this.t('images.title') },
);
if (!state) {
if (!state || state === ImageMangerStates.UNREADY) {
return;
}
Expand Down

0 comments on commit f4c1fa1

Please sign in to comment.