Skip to content

Commit

Permalink
refactor: route cancel to the regular cancel function
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Sep 6, 2024
1 parent 2fe93e1 commit ecf87cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/components/dialogs/CancelJobDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ export default class CancelJobDialog extends Mixins(BaseMixin) {
@Prop({ type: Boolean, default: false }) showDialog!: boolean
cancelJob() {
this.$socket.emit('printer.print.cancel', {}, { loading: 'statusPrintCancel' })
this.closePrompt()
this.$emit('cancel-job')
}
closePrompt() {
Expand Down
7 changes: 6 additions & 1 deletion src/components/panels/StatusPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@
</v-tab-item>
</v-tabs-items>
</panel>
<cancel-job-dialog :show-dialog="showCancelJobDialog" @close="showCancelJobDialog = false" />
<cancel-job-dialog
:show-dialog="showCancelJobDialog"
@cancel-job="cancelJob"
@close="showCancelJobDialog = false" />
</div>
</template>

Expand Down Expand Up @@ -142,9 +145,11 @@ import {
mdiDotsVertical,
} from '@mdi/js'
import { PrinterStateMacro } from '@/store/printer/types'
import CancelJobDialog from '@/components/dialogs/CancelJobDialog.vue'
@Component({
components: {
CancelJobDialog,
KlippyStatePanel,
MinSettingsPanel,
Panel,
Expand Down

0 comments on commit ecf87cd

Please sign in to comment.