Skip to content

Commit

Permalink
Improved: logic to handle if no popover button selected (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Oct 9, 2023
1 parent f3dba0c commit b9f48de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/views/Completed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ export default defineComponent({
});
popover.onDidDismiss().then(async(result) => {
const selectedMethod = result.data.selectedMethod
const selectedMethod = result.data?.selectedMethod
// Calls method which is clicked on the popover, functions name returns when popover dismiss.
// Retrieved the method name on popover dismissal and respective method is called.
if(typeof(this[selectedMethod]) === 'function') {
await (this as any)[selectedMethod](order);
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/ShippingPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
IonList
} from "@ionic/vue";
import { defineComponent } from "vue";
import { printOutline, lockOpenOutline, receiptOutline, warningOutline } from 'ionicons/icons'
import { lockOpenOutline, printOutline, receiptOutline, warningOutline } from 'ionicons/icons'
import { Actions, hasPermission } from '@/authorization'
import { popoverController } from "@ionic/core";
export default defineComponent({
Expand All @@ -38,7 +38,7 @@ export default defineComponent({
methods: {
closeModal(selectedMethod: string) {
// Sending function name to be called after popover dismiss.
popoverController.dismiss({selectedMethod: selectedMethod})
popoverController.dismiss({selectedMethod})
}
},
setup() {
Expand Down

0 comments on commit b9f48de

Please sign in to comment.