diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-01-26 17:03:51 -0500 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-02-05 14:20:39 -0500 |
| commit | 9f88ccec5f8a18e2555530b0678b05bf1ae61248 (patch) | |
| tree | 70ac5e2c8a27f344ced0c0640598c90b95ce83ec /packages/frontend/src/components/MkFollowButton.vue | |
| parent | allow MkFollowButton to be disabled (diff) | |
| download | sharkey-9f88ccec5f8a18e2555530b0678b05bf1ae61248.tar.gz sharkey-9f88ccec5f8a18e2555530b0678b05bf1ae61248.tar.bz2 sharkey-9f88ccec5f8a18e2555530b0678b05bf1ae61248.zip | |
emit waiting status from MkFollowButton
Diffstat (limited to 'packages/frontend/src/components/MkFollowButton.vue')
| -rw-r--r-- | packages/frontend/src/components/MkFollowButton.vue | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/frontend/src/components/MkFollowButton.vue b/packages/frontend/src/components/MkFollowButton.vue index 277d116845..42e8485f46 100644 --- a/packages/frontend/src/components/MkFollowButton.vue +++ b/packages/frontend/src/components/MkFollowButton.vue @@ -35,7 +35,7 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <script lang="ts" setup> -import { onBeforeUnmount, onMounted, ref } from 'vue'; +import { onBeforeUnmount, onMounted, ref, watch } from 'vue'; import * as Misskey from 'misskey-js'; import { host } from '@@/js/config.js'; import * as os from '@/os.js'; @@ -59,7 +59,8 @@ const props = withDefaults(defineProps<{ }); const emit = defineEmits<{ - (_: 'update:user', value: Misskey.entities.UserDetailed): void + (_: 'update:user', value: Misskey.entities.UserDetailed): void, + (_: 'update:wait', value: boolean): void, }>(); const isFollowing = ref(props.user.isFollowing); @@ -67,6 +68,9 @@ const hasPendingFollowRequestFromYou = ref(props.user.hasPendingFollowRequestFro const wait = ref(false); const connection = useStream().useChannel('main'); +// Emit the "wait" status so external components can synchronize state +watch(wait, value => emit('update:wait', value)); + if (props.user.isFollowing == null && $i) { misskeyApi('users/show', { userId: props.user.id, |