Inject native router only in reactive scopes (#1730)

This commit is contained in:
Sasha Sorokin
2024-06-15 14:27:38 +02:00
committed by GitHub
parent 61fd6f1741
commit bd49d6bd89
12 changed files with 17 additions and 21 deletions

View File

@@ -42,7 +42,7 @@
<script setup>
import { XIcon as CrossIcon, CheckIcon, Modal, Button } from 'omorphia'
const router = useRouter()
const router = useNativeRouter()
const name = ref('')
const description = ref('')

View File

@@ -996,9 +996,9 @@ async function sendMessage(status) {
stopLoading()
}
async function goToNextProject() {
const router = useRouter()
const router = useNativeRouter()
async function goToNextProject() {
const project = props.futureProjects[0]
if (!project) {

View File

@@ -56,7 +56,7 @@
<script setup>
import { XIcon as CrossIcon, CheckIcon, Modal, Button } from 'omorphia'
const router = useRouter()
const router = useNativeRouter()
const name = ref('')
const slug = ref('')

View File

@@ -98,6 +98,7 @@ const props = defineProps({
})
const emit = defineEmits(['switch-page'])
const router = useNativeRouter()
const route = useNativeRoute()
const tags = useTags()
@@ -130,9 +131,6 @@ const selectedLoaders = shallowRef(getArrayOrString(route.query.l) ?? [])
const selectedVersionTypes = shallowRef(getArrayOrString(route.query.c) ?? [])
async function updateQuery() {
const router = useRouter()
const route = useNativeRoute()
await router.replace({
query: {
...route.query,

View File

@@ -308,7 +308,7 @@ import { UiChartsCompactChart as CompactChart, UiChartsChart as Chart } from '#c
import PaletteIcon from '~/assets/icons/palette.svg?component'
const router = useRouter()
const router = useNativeRouter()
const theme = useTheme()
const props = withDefaults(