From 9492ff402285b334995c81c5957c6d3d8f83053e Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 14 Jan 2018 21:48:26 -0800 Subject: [PATCH] precache user account --- routes/settings/instances/add.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routes/settings/instances/add.html b/routes/settings/instances/add.html index 1983e98..70b3edf 100644 --- a/routes/settings/instances/add.html +++ b/routes/settings/instances/add.html @@ -53,6 +53,7 @@ import Layout from '../../_components/Layout.html'; import SettingsLayout from '../_components/SettingsLayout.html' import { registerApplication, generateAuthLink, getAccessTokenFromAuthCode } from '../../_utils/mastodon/oauth' + import { getThisUserAccount } from '../../_utils/mastodon/user' import { store } from '../../_utils/store' import { goto } from 'sapper/runtime.js' import { switchToTheme } from '../../_utils/themeEngine' @@ -157,6 +158,8 @@ }) this.store.save() switchToTheme('default') + // fire off request for account so it's cached in the SW + getThisUserAccount(currentRegisteredInstanceName, instanceData.access_token) goto('/') } }