pinafore/src/routes/_pages/requests.html
Nolan Lawson 2debddaaf6
fix: add some pages that "sapper export" missed (#1000)
Unfortunately it looks like `sapper export` works by crawling the
non-logged-in site, which means that any pages that are inaccessible
when you're not logged in don't get generated, including "pinned,"
"muted," "blocked," "requests," and "share."

Normally this isn't a problem, but it is in browsers that don't
have Service Worker; you get a 404 when you try to refresh those pages.

My fix is to just add a hidden div that links to these pages. It's not
pretty, but it works.
2019-02-16 00:48:45 -08:00

37 lines
1.1 KiB
HTML

<DynamicPageBanner title="Follow requests" icon="#fa-user-plus" />
{#if $isUserLoggedIn }
<AccountsListPage {accountsFetcher} {accountActions} />
{/if}
<script>
import AccountsListPage from '../_components/AccountsListPage.html'
import { store } from '../_store/store'
import { getFollowRequests } from '../_actions/followRequests'
import DynamicPageBanner from '../_components/DynamicPageBanner.html'
import { setFollowRequestApprovedOrRejected } from '../_actions/requests'
export default {
data: () => ({
accountActions: [
{
icon: '#fa-check',
label: 'Approve',
onclick: (accountId) => setFollowRequestApprovedOrRejected(accountId, true, true)
},
{
icon: '#fa-times',
label: 'Reject',
onclick: (accountId) => setFollowRequestApprovedOrRejected(accountId, false, true)
}
]
}),
computed: {
accountsFetcher: ({ $currentInstance, $accessToken }) => () => getFollowRequests($currentInstance, $accessToken)
},
store: () => store,
components: {
AccountsListPage,
DynamicPageBanner
}
}
</script>