pinafore/src/routes/_pages/blocked.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

32 lines
944 B
HTML

<DynamicPageBanner title="Blocked users" icon="#fa-ban" />
{#if $isUserLoggedIn }
<AccountsListPage {accountsFetcher} {accountActions} />
{/if}
<script>
import AccountsListPage from '../_components/AccountsListPage.html'
import { store } from '../_store/store'
import { getBlockedAccounts } from '../_api/blockedAndMuted'
import DynamicPageBanner from '../_components/DynamicPageBanner.html'
import { setAccountBlocked } from '../_actions/block'
export default {
data: () => ({
accountActions: [
{
icon: '#fa-unlock',
label: 'Unblock',
onclick: (accountId) => setAccountBlocked(accountId, false, true)
}
]
}),
computed: {
accountsFetcher: ({ $currentInstance, $accessToken }) => () => getBlockedAccounts($currentInstance, $accessToken)
},
store: () => store,
components: {
AccountsListPage,
DynamicPageBanner
}
}
</script>