fix: lifecycle for copy to clipboard and remove image

This commit is contained in:
Joxit 2021-04-06 06:16:01 +02:00
parent 83f15aa267
commit 6d4d507db5
No known key found for this signature in database
GPG Key ID: F526592B8E012263
2 changed files with 8 additions and 4 deletions

View File

@ -28,13 +28,15 @@
} from '../../scripts/utils';
export default {
onBeforeMount(props, state) {
const prefix = 'docker pull ' + props.pullUrl + '/' + props.image.name;
if (props.target === 'tag') {
state.dockerCmd = prefix + ':' + props.image.tag;
} else {
state.dockerCmd = `docker pull ${props.pullUrl}/${props.image.name}:${props.image.tag}`;
}
},
onMounted(props, state) {
if (props.target !== 'tag') {
props.image.one('content-digest', (digest) => {
this.update({
dockerCmd: prefix + '@' + digest
dockerCmd: `docker pull ${props.pullUrl}/${props.image.name}@${digest}`
})
});
props.image.trigger('get-content-digest');

View File

@ -35,6 +35,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
digest
});
});
},
onMounted(props, state) {
props.image.trigger('get-content-digest');
},
onBeforeUpdate(props, state) {