|
@ -63,24 +63,34 @@ |
|
|
|
|
|
|
|
|
<!-- Identity Details --> |
|
|
<!-- Identity Details --> |
|
|
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4"> |
|
|
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4"> |
|
|
<h2 v-if="givenName" class="text-xl font-semibold mb-2"> |
|
|
<div v-if="givenName"> |
|
|
|
|
|
<h2 class="text-xl font-semibold mb-2"> |
|
|
{{ givenName }} |
|
|
{{ givenName }} |
|
|
<router-link :to="{ name: 'new-edit-account' }"> |
|
|
<router-link :to="{ name: 'new-edit-account' }"> |
|
|
<fa icon="pen" class="text-xs text-blue-500 mb-1"></fa> |
|
|
<fa icon="pen" class="text-xs text-blue-500 mb-1"></fa> |
|
|
</router-link> |
|
|
</router-link> |
|
|
|
|
|
</h2> |
|
|
|
|
|
</div> |
|
|
|
|
|
<span v-else> |
|
|
|
|
|
<router-link |
|
|
|
|
|
:to="{ name: 'new-edit-account' }" |
|
|
|
|
|
class="block w-full text-center text-md bg-amber-200 text-blue-500 uppercase border border-dashed border-slate-400 px-1.5 py-2 rounded-md mb-2" |
|
|
|
|
|
> |
|
|
|
|
|
Set Your Name |
|
|
|
|
|
</router-link> |
|
|
|
|
|
</span> |
|
|
<div class="flex justify-center mt-4"> |
|
|
<div class="flex justify-center mt-4"> |
|
|
<span v-if="profileImageUrl" class="flex justify-between"> |
|
|
<span v-if="profileImageUrl" class="flex justify-between"> |
|
|
<a |
|
|
<EntityIcon |
|
|
:href="profileImageUrl" |
|
|
:icon-size="96" |
|
|
target="_blank" |
|
|
:profileImageUrl="profileImageUrl" |
|
|
class="text-blue-500 ml-4" |
|
|
class="inline-block align-text-bottom border border-slate-300 rounded" |
|
|
> |
|
|
@click="showLargeIdenticonUrl = profileImageUrl" |
|
|
<img :src="profileImageUrl" class="h-24 rounded-xl" /> |
|
|
/> |
|
|
</a> |
|
|
|
|
|
<fa |
|
|
<fa |
|
|
icon="trash-can" |
|
|
icon="trash-can" |
|
|
@click="confirmDeleteImage" |
|
|
@click="confirmDeleteImage" |
|
|
class="text-red-500 fa-fw ml-8 mt-10" |
|
|
class="text-red-500 fa-fw ml-8 mt-8 w-12 h-12" |
|
|
/> |
|
|
/> |
|
|
</span> |
|
|
</span> |
|
|
<span v-else> |
|
|
<span v-else> |
|
@ -92,15 +102,38 @@ |
|
|
</span> |
|
|
</span> |
|
|
<GiftedPhotoDialog ref="photoDialog" /> |
|
|
<GiftedPhotoDialog ref="photoDialog" /> |
|
|
</div> |
|
|
</div> |
|
|
</h2> |
|
|
<div class="mt-4"> |
|
|
<span v-else> |
|
|
<div class="flex justify-center"> |
|
|
<router-link |
|
|
... and those without your image see this: |
|
|
:to="{ name: 'new-edit-account' }" |
|
|
</div> |
|
|
class="block w-full text-center text-md bg-amber-200 text-blue-500 uppercase border border-dashed border-slate-400 px-1.5 py-2 rounded-md mb-2" |
|
|
<div class="flex justify-center"> |
|
|
|
|
|
<EntityIcon |
|
|
|
|
|
:entityId="activeDid" |
|
|
|
|
|
:iconSize="64" |
|
|
|
|
|
class="inline-block align-middle border border-slate-300 rounded-md mr-1" |
|
|
|
|
|
@click="showLargeIdenticonId = activeDid" |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div |
|
|
|
|
|
v-if="showLargeIdenticonId || showLargeIdenticonUrl" |
|
|
|
|
|
class="fixed z-[100] top-0 inset-x-0 w-full" |
|
|
> |
|
|
> |
|
|
Set Your Name |
|
|
<div |
|
|
</router-link> |
|
|
class="absolute inset-0 h-screen flex flex-col items-center justify-center bg-slate-900/50" |
|
|
</span> |
|
|
> |
|
|
|
|
|
<EntityIcon |
|
|
|
|
|
:entityId="showLargeIdenticonId" |
|
|
|
|
|
:iconSize="512" |
|
|
|
|
|
:profileImageUrl="showLargeIdenticonUrl" |
|
|
|
|
|
class="flex w-11/12 max-w-sm mx-auto mb-3 overflow-hidden bg-white rounded-lg shadow-lg" |
|
|
|
|
|
@click=" |
|
|
|
|
|
showLargeIdenticonId = undefined; |
|
|
|
|
|
showLargeIdenticonUrl = undefined; |
|
|
|
|
|
" |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="text-slate-500 text-sm font-bold">ID</div> |
|
|
<div class="text-slate-500 text-sm font-bold">ID</div> |
|
|
<div class="text-sm text-slate-500 flex justify-start items-center mb-1"> |
|
|
<div class="text-sm text-slate-500 flex justify-start items-center mb-1"> |
|
@ -580,6 +613,8 @@ import { |
|
|
ImageRateLimits, |
|
|
ImageRateLimits, |
|
|
} from "@/libs/endorserServer"; |
|
|
} from "@/libs/endorserServer"; |
|
|
import { Buffer } from "buffer/"; |
|
|
import { Buffer } from "buffer/"; |
|
|
|
|
|
import EntityIcon from "@/components/EntityIcon.vue"; |
|
|
|
|
|
import {Contact} from "@/db/tables/contacts"; |
|
|
|
|
|
|
|
|
interface IAccount { |
|
|
interface IAccount { |
|
|
did: string; |
|
|
did: string; |
|
@ -591,7 +626,7 @@ interface IAccount { |
|
|
const inputFileNameRef = ref<Blob>(); |
|
|
const inputFileNameRef = ref<Blob>(); |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
components: { GiftedPhotoDialog, QuickNav, TopMessage }, |
|
|
components: {EntityIcon, GiftedPhotoDialog, QuickNav, TopMessage }, |
|
|
}) |
|
|
}) |
|
|
export default class AccountViewView extends Vue { |
|
|
export default class AccountViewView extends Vue { |
|
|
$notify!: (notification: NotificationIface, timeout?: number) => void; |
|
|
$notify!: (notification: NotificationIface, timeout?: number) => void; |
|
@ -614,6 +649,8 @@ export default class AccountViewView extends Vue { |
|
|
profileImageUrl?: string; |
|
|
profileImageUrl?: string; |
|
|
publicHex = ""; |
|
|
publicHex = ""; |
|
|
publicBase64 = ""; |
|
|
publicBase64 = ""; |
|
|
|
|
|
showLargeIdenticonId?: string; |
|
|
|
|
|
showLargeIdenticonUrl?: string; |
|
|
webPushServer = ""; |
|
|
webPushServer = ""; |
|
|
webPushServerInput = ""; |
|
|
webPushServerInput = ""; |
|
|
|
|
|
|
|
@ -1290,14 +1327,18 @@ export default class AccountViewView extends Vue { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
openPhotoDialog() { |
|
|
openPhotoDialog() { |
|
|
(this.$refs.photoDialog as GiftedPhotoDialog).open(async (imgUrl) => { |
|
|
(this.$refs.photoDialog as GiftedPhotoDialog).open( |
|
|
|
|
|
async (imgUrl) => { |
|
|
await db.open(); |
|
|
await db.open(); |
|
|
db.settings.update(MASTER_SETTINGS_KEY, { |
|
|
db.settings.update(MASTER_SETTINGS_KEY, { |
|
|
profileImageUrl: imgUrl, |
|
|
profileImageUrl: imgUrl, |
|
|
}); |
|
|
}); |
|
|
this.profileImageUrl = imgUrl; |
|
|
this.profileImageUrl = imgUrl; |
|
|
//console.log("Got image URL:", imgUrl); |
|
|
//console.log("Got image URL:", imgUrl); |
|
|
}, true); |
|
|
}, |
|
|
|
|
|
true, |
|
|
|
|
|
"profile", |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
confirmDeleteImage() { |
|
|
confirmDeleteImage() { |
|
@ -1351,14 +1392,14 @@ export default class AccountViewView extends Vue { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.profileImageUrl = ""; |
|
|
this.profileImageUrl = undefined; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error("Error deleting image:", error); |
|
|
console.error("Error deleting image:", error); |
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
if ((error as any).response.status === 404) { |
|
|
if ((error as any).response.status === 404) { |
|
|
console.log("The image was already deleted:", error); |
|
|
console.log("The image was already deleted:", error); |
|
|
|
|
|
|
|
|
this.profileImageUrl = ""; |
|
|
this.profileImageUrl = undefined; |
|
|
|
|
|
|
|
|
// it already doesn't exist so we won't say anything to the user |
|
|
// it already doesn't exist so we won't say anything to the user |
|
|
} else { |
|
|
} else { |
|
|