bring directory back
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
<template>
|
||||
<main>
|
||||
<h1>Test</h1>
|
||||
<p>{{ environment }}</p>
|
||||
</main>
|
||||
<!-- <main v-if="loaded" class="directory layout-block">
|
||||
<main v-if="loaded" class="directory layout-block">
|
||||
<category-row
|
||||
v-for="(category, i) in categories"
|
||||
:index="i"
|
||||
@@ -22,58 +18,54 @@
|
||||
<decryption-warning :failedIds="decryptionFailures" />
|
||||
</main>
|
||||
|
||||
<page-loading v-else /> -->
|
||||
<page-loading v-else />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useEnvironment } from '@/composables/useEnvironment'
|
||||
import DecryptionWarning from '@/components/DecryptionWarning.vue'
|
||||
import { onMounted, ref, watchEffect, watch } from 'vue'
|
||||
import CategoryRow from '@/components/CategoryRow.vue'
|
||||
import PageLoading from '@/components/PageLoading.vue'
|
||||
import NoteRow from '@/components/NoteRow.vue'
|
||||
import useNotes from '@/composables/useNotes'
|
||||
import NewNote from '@/components/NewNote.vue'
|
||||
import { useMagicKeys } from '@vueuse/core'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const environment = useEnvironment()
|
||||
const router = useRouter()
|
||||
const {
|
||||
categories,
|
||||
loadCategories,
|
||||
loadCategoryNotes,
|
||||
changeCount,
|
||||
decryptionFailures,
|
||||
} = useNotes()
|
||||
|
||||
// import DecryptionWarning from '@/components/DecryptionWarning.vue'
|
||||
// import { onMounted, ref, watchEffect, watch } from 'vue'
|
||||
// import CategoryRow from '@/components/CategoryRow.vue'
|
||||
// import PageLoading from '@/components/PageLoading.vue'
|
||||
// import NoteRow from '@/components/NoteRow.vue'
|
||||
// import useNotes from '@/composables/useNotes'
|
||||
// import NewNote from '@/components/NewNote.vue'
|
||||
// import { useMagicKeys } from '@vueuse/core'
|
||||
// import { useRouter } from 'vue-router'
|
||||
const notes = ref()
|
||||
const loaded = ref(false)
|
||||
|
||||
// const router = useRouter()
|
||||
// const {
|
||||
// categories,
|
||||
// loadCategories,
|
||||
// loadCategoryNotes,
|
||||
// changeCount,
|
||||
// decryptionFailures,
|
||||
// } = useNotes()
|
||||
const refreshNotes = async () => {
|
||||
loaded.value = false
|
||||
await loadCategories()
|
||||
notes.value = await loadCategoryNotes()
|
||||
loaded.value = true
|
||||
}
|
||||
|
||||
// const notes = ref()
|
||||
// const loaded = ref(false)
|
||||
onMounted(async () => {
|
||||
await refreshNotes()
|
||||
})
|
||||
|
||||
// const refreshNotes = async () => {
|
||||
// loaded.value = false
|
||||
// await loadCategories()
|
||||
// notes.value = await loadCategoryNotes()
|
||||
// loaded.value = true
|
||||
// }
|
||||
watch(changeCount, async () => {
|
||||
await refreshNotes()
|
||||
})
|
||||
|
||||
// onMounted(async () => {
|
||||
// await refreshNotes()
|
||||
// })
|
||||
|
||||
// watch(changeCount, async () => {
|
||||
// await refreshNotes()
|
||||
// })
|
||||
|
||||
// // New category keyboard shortcut
|
||||
// const { ctrl, t } = useMagicKeys()
|
||||
// watchEffect(() => {
|
||||
// if (ctrl.value && t.value) {
|
||||
// router.push('/category')
|
||||
// }
|
||||
// })
|
||||
// New category keyboard shortcut
|
||||
const { ctrl, t } = useMagicKeys()
|
||||
watchEffect(() => {
|
||||
if (ctrl.value && t.value) {
|
||||
router.push('/category')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user