Fix frame pacing
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useNativeRouter } from '@native-vue-router/core'
|
||||
import AppHeader from '../components/AppHeader.vue'
|
||||
import { useDemoStore } from '../data'
|
||||
@@ -6,6 +7,12 @@ import { pwaBuildId, pwaEnvironment } from '../pwa'
|
||||
|
||||
const store = useDemoStore()
|
||||
const native = useNativeRouter()
|
||||
const unloadResult = ref('Unload cached Stories')
|
||||
|
||||
function unloadStories() {
|
||||
const count = native.unload('/stories')
|
||||
unloadResult.value = count ? `Unloaded ${count} Stories view` : 'Stories is not cached'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -32,6 +39,7 @@ const native = useNativeRouter()
|
||||
<p>Sibling tabs are created on first visit, then retained. Back-stack screens stay warm only while they remain useful as a predictive-back target.</p>
|
||||
</section>
|
||||
<button class="reset-button reset-button--neutral" type="button" @click="native.trimCache()">Trim inactive view cache</button>
|
||||
<button class="reset-button reset-button--neutral" data-testid="unload-stories" type="button" @click="unloadStories">{{ unloadResult }}</button>
|
||||
<section class="settings-group">
|
||||
<h2>Simulation</h2>
|
||||
<label><span><strong>Network latency</strong><small>{{ store.settings.simulatedLatency }} ms</small></span><input v-model.number="store.settings.simulatedLatency" type="range" min="0" max="1200" step="20" /></label>
|
||||
|
||||
Reference in New Issue
Block a user