This commit is contained in:
j3d1 2026-09-05 16:20:44 +02:00
parent 9814ec7ecd
commit 197f173097
14 changed files with 170 additions and 89 deletions

View file

@ -32,9 +32,11 @@
<fs-file-source @input="uploadPicture">
<span class="btn btn-primary"><i class="fas fa-upload"></i> Upload</span>
</fs-file-source>
<button class="btn btn-outline-secondary ml-2" type="button" @click="removePicture">
<guarded-button class="btn btn-outline-secondary ml-2" type="button"
confirm-message="Are you sure you want to remove your profile picture?"
@confirm="removePicture">
Remove
</button>
</guarded-button>
</div>
<small>For best results, use an image at least 128px by
128px in .jpg format</small>
@ -107,10 +109,11 @@
import {mapActions, mapState} from "vuex";
import AuthenticatedImage from "@/components/AuthenticatedImage.vue";
import FsFileSource from "@/components/inputs/FsFileSource.vue";
import GuardedButton from "@/components/GuardedButton.vue";
export default {
name: 'Account',
components: {AuthenticatedImage, FsFileSource},
components: {AuthenticatedImage, FsFileSource, GuardedButton},
computed: {
...mapState(['user', 'user_profile']),
profilePictureSrc() {
@ -130,7 +133,6 @@ export default {
await this.updateUserProfilePicture({file: image});
},
async removePicture() {
if (!confirm('Are you sure you want to remove your profile picture?')) return;
await this.updateUserProfilePicture({file: null});
}
},