|
@@ -1,6 +1,5 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { defineAsyncComponent, onMounted } from "vue";
|
|
import { defineAsyncComponent, onMounted } from "vue";
|
|
-import { useRoute } from "vue-router";
|
|
|
|
import Toast from "toasters";
|
|
import Toast from "toasters";
|
|
import { storeToRefs } from "pinia";
|
|
import { storeToRefs } from "pinia";
|
|
import { useWebsocketsStore } from "@/stores/websockets";
|
|
import { useWebsocketsStore } from "@/stores/websockets";
|
|
@@ -22,8 +21,6 @@ const QuickConfirm = defineAsyncComponent(
|
|
() => import("@/components/QuickConfirm.vue")
|
|
() => import("@/components/QuickConfirm.vue")
|
|
);
|
|
);
|
|
|
|
|
|
-const route = useRoute();
|
|
|
|
-
|
|
|
|
const { socket } = useWebsocketsStore();
|
|
const { socket } = useWebsocketsStore();
|
|
|
|
|
|
const { openModal } = useModalsStore();
|
|
const { openModal } = useModalsStore();
|
|
@@ -89,6 +86,24 @@ const removeActivities = () => {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+const removeAccount = () => {
|
|
|
|
+ openModal({
|
|
|
|
+ modal: "confirm",
|
|
|
|
+ props: {
|
|
|
|
+ message: 'Are you sure you would like to delete your account and all associated data?',
|
|
|
|
+ onCompleted: async () => {
|
|
|
|
+ try {
|
|
|
|
+ await runJob('data.users.deleteById', {
|
|
|
|
+ _id: currentUser.value._id
|
|
|
|
+ });
|
|
|
|
+ } catch (error) {
|
|
|
|
+ new Toast(error.message);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
await onReady(async () => {
|
|
await onReady(async () => {
|
|
setModelValues(await registerModel(currentUser.value), [
|
|
setModelValues(await registerModel(currentUser.value), [
|
|
@@ -96,16 +111,6 @@ onMounted(async () => {
|
|
"emailAddress"
|
|
"emailAddress"
|
|
]);
|
|
]);
|
|
});
|
|
});
|
|
-
|
|
|
|
- if (
|
|
|
|
- route.query.removeAccount === "relinked-github" &&
|
|
|
|
- !localStorage.getItem("github_redirect")
|
|
|
|
- ) {
|
|
|
|
- openModal({
|
|
|
|
- modal: "removeAccount",
|
|
|
|
- props: { githubLinkConfirmed: true }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -185,7 +190,7 @@ onMounted(async () => {
|
|
</a>
|
|
</a>
|
|
</quick-confirm>
|
|
</quick-confirm>
|
|
|
|
|
|
- <a class="button is-danger" @click="openModal('removeAccount')">
|
|
|
|
|
|
+ <a class="button is-danger" @click="removeAccount()">
|
|
<i class="material-icons icon-with-button">delete</i>
|
|
<i class="material-icons icon-with-button">delete</i>
|
|
Remove my account
|
|
Remove my account
|
|
</a>
|
|
</a>
|