crop the image and store online and in settings

This commit is contained in:
2024-04-18 20:27:43 -06:00
parent 50cae65214
commit 1009574721
4 changed files with 101 additions and 16 deletions

View File

@@ -611,7 +611,7 @@ export default class AccountViewView extends Vue {
isRegistered = false;
isSubscribed = false;
notificationMaybeChanged = false;
profileImageUrl: string | null = null;
profileImageUrl?: string;
publicHex = "";
publicBase64 = "";
webPushServer = "";
@@ -684,6 +684,7 @@ export default class AccountViewView extends Vue {
(settings?.firstName || "") +
(settings?.lastName ? ` ${settings.lastName}` : ""); // pre v 0.1.3
this.isRegistered = !!settings?.isRegistered;
this.profileImageUrl = settings?.profileImageUrl as string;
this.showContactGives = !!settings?.showContactGivesInline;
this.showShortcutBvc = !!settings?.showShortcutBvc;
this.warnIfProdServer = !!settings?.warnIfProdServer;
@@ -1289,10 +1290,14 @@ export default class AccountViewView extends Vue {
}
openPhotoDialog() {
(this.$refs.photoDialog as GiftedPhotoDialog).open((imgUrl) => {
(this.$refs.photoDialog as GiftedPhotoDialog).open(async (imgUrl) => {
await db.open();
db.settings.update(MASTER_SETTINGS_KEY, {
profileImageUrl: imgUrl,
});
this.profileImageUrl = imgUrl;
console.log("Got image URL:", imgUrl);
});
//console.log("Got image URL:", imgUrl);
}, true);
}
confirmDeleteImage() {