2debddaaf6
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.
32 lines
944 B
HTML
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>
|