Skip to content

Commit

Permalink
Use the composable in module scope, as can't define setup on a mixin …
Browse files Browse the repository at this point in the history
…if the consuming component also defines setup.
  • Loading branch information
rtibbles committed Dec 13, 2024
1 parent f994e5c commit 74dcc1a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions kolibri/plugins/device/assets/src/views/taskNotificationMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ const TaskSnackbarStrings = createTranslator('TaskSnackbarStrings', {
},
});

const { createSnackbar } = useSnackbar();

export default {
data() {
return {
showSnackbarWhenTaskHasFinished: true,
};
},
setup() {
const { createSnackbar } = useSnackbar();
return { createSnackbar };
},
computed: {
watchedTaskId() {
return this.$store.state.manageContent.watchedTaskId;
Expand Down Expand Up @@ -65,16 +63,16 @@ export default {
this.$router.push({ name: PageNames.MANAGE_TASKS });
},
createTaskFailedSnackbar() {
this.createSnackbar(TaskSnackbarStrings.$tr('taskFailed'));
createSnackbar(TaskSnackbarStrings.$tr('taskFailed'));
},
createTaskFinishedSnackbar() {
this.createSnackbar({
createSnackbar({
text: TaskSnackbarStrings.$tr('taskFinished'),
autoDismiss: true,
});
},
createTaskStartedSnackbar() {
this.createSnackbar({
createSnackbar({
text: TaskSnackbarStrings.$tr('taskStarted'),
autoDismiss: true,
});
Expand Down

0 comments on commit 74dcc1a

Please sign in to comment.