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.
This commit is contained in:
parent
839e8e35c4
commit
2debddaaf6
|
@ -1,5 +1,7 @@
|
|||
<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'
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<DynamicPageBanner title="Muted users" icon="#fa-volume-off" />
|
||||
{#if $isUserLoggedIn }
|
||||
<AccountsListPage {accountsFetcher} {accountActions} />
|
||||
{/if}
|
||||
<script>
|
||||
import AccountsListPage from '../_components/AccountsListPage.html'
|
||||
import { store } from '../_store/store'
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<DynamicPageBanner title="Pinned toots" icon="#fa-thumb-tack" />
|
||||
{#if $isUserLoggedIn }
|
||||
<div class="pinned-toots-page">
|
||||
{#if loading}
|
||||
<LoadingPage />
|
||||
|
@ -10,6 +11,7 @@
|
|||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<style>
|
||||
.pinned-toots-page {
|
||||
padding: 20px 20px;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<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'
|
||||
|
|
|
@ -12,6 +12,15 @@
|
|||
<p>Icons provided by <ExternalLink href="http://fontawesome.io/">Font Awesome</ExternalLink>.</p>
|
||||
|
||||
<p>Logo thanks to "sailboat" by Gregor Cresnar from <ExternalLink href="https://thenounproject.com/">the Noun Project</ExternalLink>.</p>
|
||||
|
||||
<div style="display: none">
|
||||
<!-- TODO: this is just a hack so that `sapper export` knows to crawl these files -->
|
||||
<a href="/muted">Muted</a>
|
||||
<a href="/blocked">Blocked</a>
|
||||
<a href="/pinned">Pinned</a>
|
||||
<a href="/requests">Requests</a>
|
||||
<a href="/share">Share</a>
|
||||
</div>
|
||||
</SettingsLayout>
|
||||
<script>
|
||||
import SettingsLayout from '../../_components/settings/SettingsLayout.html'
|
||||
|
|
Loading…
Reference in New Issue