Browse Source

Feature: context-based default camera

- Specify the default camera (front / back) to use
pull/135/head
Jose Olarte III 1 week ago
parent
commit
0a85bea533
  1. 6
      src/components/ImageMethodDialog.vue
  2. 1
      src/views/AccountViewView.vue
  3. 2
      src/views/GiftedDetailsView.vue

6
src/components/ImageMethodDialog.vue

@ -271,6 +271,11 @@ const inputImageFileNameRef = ref<Blob>();
type: Boolean, type: Boolean,
default: true, default: true,
}, },
defaultCameraMode: {
type: String,
default: 'environment',
validator: (value: string) => ['environment', 'user'].includes(value)
}
}, },
}) })
export default class ImageMethodDialog extends Vue { export default class ImageMethodDialog extends Vue {
@ -378,6 +383,7 @@ export default class ImageMethodDialog extends Vue {
this.crop = !!crop; this.crop = !!crop;
this.imageCallback = setImageFn; this.imageCallback = setImageFn;
this.visible = true; this.visible = true;
this.currentFacingMode = this.defaultCameraMode as 'environment' | 'user';
// Start camera preview immediately if not on mobile // Start camera preview immediately if not on mobile
if (!this.platformCapabilities.isNativeApp) { if (!this.platformCapabilities.isNativeApp) {

1
src/views/AccountViewView.vue

@ -115,6 +115,7 @@
<ImageMethodDialog <ImageMethodDialog
ref="imageMethodDialog" ref="imageMethodDialog"
:is-registered="isRegistered" :is-registered="isRegistered"
default-camera-mode="user"
/> />
</div> </div>
<div class="mt-4"> <div class="mt-4">

2
src/views/GiftedDetailsView.vue

@ -93,7 +93,7 @@
/> />
</span> </span>
</div> </div>
<ImageMethodDialog ref="imageDialog" /> <ImageMethodDialog ref="imageDialog" default-camera-mode="environment" />
<div class="mt-4 flex justify-between gap-2"> <div class="mt-4 flex justify-between gap-2">
<!-- First Column for Giver --> <!-- First Column for Giver -->

Loading…
Cancel
Save