Skip to content

Commit

Permalink
Linting error removed
Browse files Browse the repository at this point in the history
  • Loading branch information
GarvitSinghal47 committed Jan 4, 2024
1 parent fc8b8cf commit 9f85c90
Showing 1 changed file with 40 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,48 +256,52 @@
});
},
},
watch: {
taskPercentage(newPercentage) {
if (newPercentage !== null) {
const formattedPercentage = (newPercentage * 100).toFixed(2) + '%';
const channelName = this.task.extra_metadata.channel_name || this.$tr('unknownChannelName');
let titlePrefix = '';
if (this.task.type === TaskTypes.REMOTECONTENTIMPORT ||
this.task.type === TaskTypes.DISKCONTENTIMPORT) {
titlePrefix = this.$tr('importChannelWhole', { channelName });
} else if (this.task.type === TaskTypes.DELETECHANNEL
|| this.task.type === TaskTypes.DELETECONTENT) {
titlePrefix = this.$tr('deleteChannelWhole', { channelName });
}
document.title = `${formattedPercentage} - ${titlePrefix}`;
}
},
'task.status': {
immediate: true,
handler(newStatus) {
const channelName = this.task.extra_metadata.channel_name || this.$tr('unknownChannelName');
if (newStatus === TaskStatuses.CANCELED) {
document.title = 'Cancelled - ' + channelName;
} else if (newStatus === TaskStatuses.FAILED) {
document.title = 'Failed - ' + channelName;
} else if (newStatus === TaskStatuses.COMPLETED) {
document.title = 'Completed - ' + channelName;
} else {
document.title = "Task manager";
}
watch: {
taskPercentage(newPercentage) {
if (newPercentage !== null) {
const formattedPercentage = (newPercentage * 100).toFixed(2) + '%';
const channelName =
this.task.extra_metadata.channel_name || this.$tr('unknownChannelName');
let titlePrefix = '';
if (
this.task.type === TaskTypes.REMOTECONTENTIMPORT ||
this.task.type === TaskTypes.DISKCONTENTIMPORT
) {
titlePrefix = this.$tr('importChannelWhole', { channelName });
} else if (
this.task.type === TaskTypes.DELETECHANNEL ||
this.task.type === TaskTypes.DELETECONTENT
) {
titlePrefix = this.$tr('deleteChannelWhole', { channelName });
}
document.title = `${formattedPercentage} - ${titlePrefix}`;
}
},
'task.status': {
immediate: true,
handler(newStatus) {
const channelName =
this.task.extra_metadata.channel_name || this.$tr('unknownChannelName');
if (newStatus === TaskStatuses.CANCELED) {
document.title = 'Cancelled - ' + channelName;
} else if (newStatus === TaskStatuses.FAILED) {
document.title = 'Failed - ' + channelName;
} else if (newStatus === TaskStatuses.COMPLETED) {
document.title = 'Completed - ' + channelName;
} else {
document.title = 'Task manager';
}
},
},
},
},
},
methods: {
handleClick() {
if (this.taskIsCompleted || this.taskIsFailed) {
this.$emit('clickclear');
document.title = 'Task Manager';
document.title = 'Task manager';
} else {
this.$emit('clickcancel');
}
Expand Down

0 comments on commit 9f85c90

Please sign in to comment.