displayed success message on profile state change
This commit is contained in:
@@ -11,6 +11,7 @@ import { useMemberDirectory } from "@/stores/memberDirectory";
|
|||||||
import { useUserStore } from "@/stores/user";
|
import { useUserStore } from "@/stores/user";
|
||||||
|
|
||||||
const saving = ref(false);
|
const saving = ref(false);
|
||||||
|
const saveSuccess = ref(false);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const showLoading = ref(false);
|
const showLoading = ref(false);
|
||||||
const form = ref<memberSettings>();
|
const form = ref<memberSettings>();
|
||||||
@@ -20,12 +21,14 @@ const userStore = useUserStore()
|
|||||||
|
|
||||||
function saveSettings() {
|
function saveSettings() {
|
||||||
saving.value = true;
|
saving.value = true;
|
||||||
|
saveSuccess.value = false;
|
||||||
|
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
// Replace with your API save call
|
// Replace with your API save call
|
||||||
setMemberSettings(form.value);
|
setMemberSettings(form.value);
|
||||||
saving.value = false;
|
saving.value = false;
|
||||||
memberDictionary.invalidateMember(userStore.user.id)
|
memberDictionary.invalidateMember(userStore.user.member.member_id)
|
||||||
|
saveSuccess.value = true;
|
||||||
}, 800);
|
}, 800);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +77,8 @@ onMounted(async () => {
|
|||||||
</CardContent>
|
</CardContent>
|
||||||
</Transition>
|
</Transition>
|
||||||
|
|
||||||
<CardFooter class="flex justify-end">
|
<CardFooter class="flex justify-end gap-5 items-center">
|
||||||
|
<p v-if="saveSuccess" class="text-green-500">Profile saved</p>
|
||||||
<Button @click="saveSettings" :disabled="saving">
|
<Button @click="saveSettings" :disabled="saving">
|
||||||
{{ saving ? "Saving..." : "Save Changes" }}
|
{{ saving ? "Saving..." : "Save Changes" }}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user