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