diff --git a/src/renderer/components/TimelineSpace/SideMenu.vue b/src/renderer/components/TimelineSpace/SideMenu.vue index 4cabdcba..f85da4ff 100644 --- a/src/renderer/components/TimelineSpace/SideMenu.vue +++ b/src/renderer/components/TimelineSpace/SideMenu.vue @@ -89,7 +89,7 @@ >([]) const tags = ref>([]) + const followRequests = ref>([]) const enabledTimelines = reactive({ home: true, notification: true, @@ -292,7 +293,6 @@ export default defineComponent({ const unreadLocalTimeline = computed(() => store.state.TimelineSpace.SideMenu.unreadLocalTimeline) const unreadDirectMessagesTimeline = computed(() => store.state.TimelineSpace.SideMenu.unreadDirectMessagesTimeline) const unreadPublicTimeline = computed(() => store.state.TimelineSpace.SideMenu.unreadPublicTimeline) - const unreadFollowRequests = computed(() => store.state.TimelineSpace.SideMenu.unreadFollowRequests) const collapse = computed(() => store.state.TimelineSpace.SideMenu.collapse) const themeColor = computed(() => store.state.App.theme.side_menu_color) const hideGlobalHeader = computed(() => store.state.GlobalHeader.hide) @@ -307,11 +307,17 @@ export default defineComponent({ account.server = s const client = generator(s.sns, s.baseURL, a.accessToken, userAgent.value) + await fetchFollowRequests(client) await fetchLists(client) await fetchTags(a) await confirmTimelines(client) }) + const fetchFollowRequests = async (client: MegalodonInterface) => { + const res = await client.getFollowRequests() + followRequests.value = res.data + } + const fetchLists = async (client: MegalodonInterface) => { const res = await client.getLists() lists.value = res.data @@ -391,7 +397,7 @@ export default defineComponent({ unreadLocalTimeline, unreadDirectMessagesTimeline, unreadPublicTimeline, - unreadFollowRequests, + followRequests, lists, tags, collapse, diff --git a/src/renderer/store/TimelineSpace/SideMenu.ts b/src/renderer/store/TimelineSpace/SideMenu.ts index 060a482c..0f54552c 100644 --- a/src/renderer/store/TimelineSpace/SideMenu.ts +++ b/src/renderer/store/TimelineSpace/SideMenu.ts @@ -10,7 +10,6 @@ export type SideMenuState = { unreadLocalTimeline: boolean unreadDirectMessagesTimeline: boolean unreadPublicTimeline: boolean - unreadFollowRequests: boolean collapse: boolean } @@ -20,7 +19,6 @@ const state = (): SideMenuState => ({ unreadLocalTimeline: false, unreadDirectMessagesTimeline: false, unreadPublicTimeline: false, - unreadFollowRequests: false, collapse: false }) @@ -30,7 +28,6 @@ export const MUTATION_TYPES = { CHANGE_UNREAD_LOCAL_TIMELINE: 'changeUnreadLocalTimeline', CHANGE_UNREAD_DIRECT_MESSAGES_TIMELINE: 'changeUnreadDirectMessagesTimeline', CHANGE_UNREAD_PUBLIC_TIMELINE: 'changeUnreadPublicTimeline', - CHANGE_UNREAD_FOLLOW_REQUESTS: 'changeUnreadFollowRequests', CHANGE_COLLAPSE: 'changeCollapse' } @@ -50,9 +47,6 @@ const mutations: MutationTree = { [MUTATION_TYPES.CHANGE_UNREAD_PUBLIC_TIMELINE]: (state, value: boolean) => { state.unreadPublicTimeline = value }, - [MUTATION_TYPES.CHANGE_UNREAD_FOLLOW_REQUESTS]: (state, value: boolean) => { - state.unreadFollowRequests = value - }, [MUTATION_TYPES.CHANGE_COLLAPSE]: (state, collapse: boolean) => { state.collapse = collapse }