feat: ユーザーメニューから「リモートユーザー情報の更新」を実行できるように
This commit is contained in:
parent
37035b3c7a
commit
76ec4844a5
|
@ -34,6 +34,7 @@
|
||||||
- 타임라인 소개 추가
|
- 타임라인 소개 추가
|
||||||
- 이용 약관을 서버 메뉴에서 볼 수 있도록
|
- 이용 약관을 서버 메뉴에서 볼 수 있도록
|
||||||
- 계정 초기 설정과 타임라인 튜토리얼을 다시 진행할 수 있도록
|
- 계정 초기 설정과 타임라인 튜토리얼을 다시 진행할 수 있도록
|
||||||
|
- 유저 메뉴에서 '리모트 유저 정보 갱신'을 진행할 수 있도록
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
- about-misskey 페이지에서 클라이언트 버전을 누르면 변경 사항을 볼 수 있음
|
- about-misskey 페이지에서 클라이언트 버전을 누르면 변경 사항을 볼 수 있음
|
||||||
|
|
|
@ -197,7 +197,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, defineAsyncComponent, watch } from 'vue';
|
import { computed, defineAsyncComponent, onMounted, watch } from 'vue';
|
||||||
import * as misskey from 'cherrypick-js';
|
import * as misskey from 'cherrypick-js';
|
||||||
import MkChart from '@/components/MkChart.vue';
|
import MkChart from '@/components/MkChart.vue';
|
||||||
import MkObjectView from '@/components/MkObjectView.vue';
|
import MkObjectView from '@/components/MkObjectView.vue';
|
||||||
|
@ -220,6 +220,7 @@ import { i18n } from '@/i18n';
|
||||||
import { iAmAdmin, $i } from '@/account';
|
import { iAmAdmin, $i } from '@/account';
|
||||||
import MkRolePreview from '@/components/MkRolePreview.vue';
|
import MkRolePreview from '@/components/MkRolePreview.vue';
|
||||||
import MkPagination, { Paging } from '@/components/MkPagination.vue';
|
import MkPagination, { Paging } from '@/components/MkPagination.vue';
|
||||||
|
import { eventBus } from '@/scripts/cherrypick/eventBus';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
userId: string;
|
userId: string;
|
||||||
|
@ -445,6 +446,10 @@ watch($$(user), () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
eventBus.on('refreshUser', () => updateRemoteUser());
|
||||||
|
});
|
||||||
|
|
||||||
const headerActions = $computed(() => []);
|
const headerActions = $computed(() => []);
|
||||||
|
|
||||||
const headerTabs = $computed(() => [{
|
const headerTabs = $computed(() => [{
|
||||||
|
|
|
@ -16,6 +16,7 @@ import { mainRouter } from '@/router';
|
||||||
import { Router } from '@/nirax';
|
import { Router } from '@/nirax';
|
||||||
import { antennasCache, rolesCache, userListsCache } from '@/cache';
|
import { antennasCache, rolesCache, userListsCache } from '@/cache';
|
||||||
import { editNickname } from '@/scripts/edit-nickname';
|
import { editNickname } from '@/scripts/edit-nickname';
|
||||||
|
import { eventBus } from '@/scripts/cherrypick/eventBus';
|
||||||
|
|
||||||
export function getUserMenu(user: misskey.entities.UserDetailed, router: Router = mainRouter) {
|
export function getUserMenu(user: misskey.entities.UserDetailed, router: Router = mainRouter) {
|
||||||
const meId = $i ? $i.id : null;
|
const meId = $i ? $i.id : null;
|
||||||
|
@ -109,6 +110,15 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router
|
||||||
}, {}, 'closed');
|
}, {}, 'closed');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function refreshUser() {
|
||||||
|
eventBus.emit('refreshUser');
|
||||||
|
}
|
||||||
|
|
||||||
|
async function updateRemoteUser() {
|
||||||
|
await os.apiWithDialog('federation/update-remote-user', { userId: user.id });
|
||||||
|
refreshUser();
|
||||||
|
}
|
||||||
|
|
||||||
async function getConfirmed(text: string): Promise<boolean> {
|
async function getConfirmed(text: string): Promise<boolean> {
|
||||||
const confirm = await os.confirm({
|
const confirm = await os.confirm({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
|
@ -367,6 +377,14 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router
|
||||||
}))]);
|
}))]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($i && meId !== user.id && user.host != null) {
|
||||||
|
menu = menu.concat([null, {
|
||||||
|
icon: 'ti ti-refresh',
|
||||||
|
text: i18n.ts.updateRemoteUser,
|
||||||
|
action: updateRemoteUser,
|
||||||
|
}]);
|
||||||
|
}
|
||||||
|
|
||||||
const cleanup = () => {
|
const cleanup = () => {
|
||||||
if (_DEV_) console.log('user menu cleanup', cleanups);
|
if (_DEV_) console.log('user menu cleanup', cleanups);
|
||||||
for (const cl of cleanups) {
|
for (const cl of cleanups) {
|
||||||
|
|
Loading…
Reference in a new issue