Merge branch 'boot-improvements' into 'develop'
Boot speed improvements See merge request pleroma/pleroma-fe!2060
This commit is contained in:
commit
c2d2ec7e18
7 changed files with 21 additions and 12 deletions
1
changelog.d/boot-improvements.change
Normal file
1
changelog.d/boot-improvements.change
Normal file
|
|
@ -0,0 +1 @@
|
|||
Speed up initial boot.
|
||||
|
|
@ -3,6 +3,11 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
|
||||
<link rel="preload" href="/static/config.json" as="fetch" crossorigin />
|
||||
<link rel="preload" href="/api/pleroma/frontend_configurations" as="fetch" crossorigin />
|
||||
<link rel="preload" href="/nodeinfo/2.1.json" as="fetch" crossorigin />
|
||||
<link rel="preload" href="/api/v1/instance" as="fetch" crossorigin />
|
||||
<link rel="preload" href="/static/pleromatan_apology_fox_small.webp" as="image" />
|
||||
<!-- putting styles here to avoid having to wait for styles to load up -->
|
||||
<style id="splashscreen">
|
||||
#splash {
|
||||
|
|
@ -148,7 +153,7 @@
|
|||
<div class="chunk" id="chunk-E">
|
||||
</div>
|
||||
</div>
|
||||
<img id="mascot" src="/static/pleromatan_apology.png">
|
||||
<img id="mascot" src="/static/pleromatan_apology_small.webp">
|
||||
</div>
|
||||
<div id="status" class="css-ok">
|
||||
<!-- (。>﹏<) -->
|
||||
|
|
|
|||
|
|
@ -931,7 +931,7 @@ option {
|
|||
|
||||
#splash {
|
||||
pointer-events: none;
|
||||
transition: opacity 2s;
|
||||
transition: opacity 0.5s;
|
||||
opacity: 1;
|
||||
|
||||
&.hidden {
|
||||
|
|
@ -960,7 +960,7 @@ option {
|
|||
|
||||
&.dead {
|
||||
animation-name: dead;
|
||||
animation-duration: 2s;
|
||||
animation-duration: 0.5s;
|
||||
animation-iteration-count: 1;
|
||||
transform: rotateX(90deg) rotateY(0) rotateZ(-45deg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,12 +230,16 @@ const getStickers = async ({ store }) => {
|
|||
const getAppSecret = async ({ store }) => {
|
||||
const { state, commit } = store
|
||||
const { oauth, instance } = state
|
||||
return getOrCreateApp({ ...oauth, instance: instance.server, commit })
|
||||
.then((app) => getClientToken({ ...app, instance: instance.server }))
|
||||
.then((token) => {
|
||||
commit('setAppToken', token.access_token)
|
||||
commit('setBackendInteractor', backendInteractorService(store.getters.getToken()))
|
||||
})
|
||||
if (oauth.userToken) {
|
||||
commit('setBackendInteractor', backendInteractorService(store.getters.getToken()))
|
||||
} else {
|
||||
return getOrCreateApp({ ...oauth, instance: instance.server, commit })
|
||||
.then((app) => getClientToken({ ...app, instance: instance.server }))
|
||||
.then((token) => {
|
||||
commit('setAppToken', token.access_token)
|
||||
commit('setBackendInteractor', backendInteractorService(store.getters.getToken()))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const resolveStaffAccounts = ({ store, accounts }) => {
|
||||
|
|
@ -377,10 +381,9 @@ const afterStoreSetup = async ({ pinia, store, storageError, i18n }) => {
|
|||
getInstanceConfig({ store })
|
||||
]).catch(e => Promise.reject(e))
|
||||
|
||||
await store.dispatch('loadDrafts')
|
||||
|
||||
// Start fetching things that don't need to block the UI
|
||||
store.dispatch('fetchMutes')
|
||||
store.dispatch('loadDrafts')
|
||||
useAnnouncementsStore().startFetchingAnnouncements()
|
||||
getTOS({ store })
|
||||
getStickers({ store })
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ const persistedStateOptions = {
|
|||
console.error('Storage error', e)
|
||||
storageError = e
|
||||
}
|
||||
document.querySelector('#mascot').src = `/static/pleromatan_apology${isFox}.png`
|
||||
document.querySelector('#mascot').src = `/static/pleromatan_apology${isFox}_small.webp`
|
||||
document.querySelector('#status').removeAttribute('class')
|
||||
document.querySelector('#status').textContent = i18n.global.t('splash.loading')
|
||||
document.querySelector('#splash-credit').textContent = i18n.global.t('update.art_by', { linkToArtist: 'pipivovott' })
|
||||
|
|
|
|||
BIN
static/pleromatan_apology_fox_small.webp
Normal file
BIN
static/pleromatan_apology_fox_small.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
BIN
static/pleromatan_apology_small.webp
Normal file
BIN
static/pleromatan_apology_small.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
Loading…
Add table
Add a link
Reference in a new issue