merge: upstream

This commit is contained in:
Marie 2023-12-23 02:09:23 +01:00
commit 5db583a3eb
701 changed files with 50809 additions and 13660 deletions

View file

@ -23,7 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
/* eslint-disable vue/no-mutating-props */
import { watch } from 'vue';
import { watch, ref } from 'vue';
import XContainer from '../page-editor.container.vue';
import MkInput from '@/components/MkInput.vue';
import MkSwitch from '@/components/MkSwitch.vue';
@ -40,19 +40,19 @@ const emit = defineEmits<{
(ev: 'update:modelValue', value: any): void;
}>();
let id: any = $ref(props.modelValue.note);
let note: any = $ref(null);
const id = ref<any>(props.modelValue.note);
const note = ref<any>(null);
watch($$(id), async () => {
if (id && (id.startsWith('http://') || id.startsWith('https://'))) {
id = (id.endsWith('/') ? id.slice(0, -1) : id).split('/').pop();
watch(id, async () => {
if (id.value && (id.value.startsWith('http://') || id.value.startsWith('https://'))) {
id.value = (id.value.endsWith('/') ? id.value.slice(0, -1) : id.value).split('/').pop();
}
emit('update:modelValue', {
...props.modelValue,
note: id,
note: id.value,
});
note = await os.api('notes/show', { noteId: id });
note.value = await os.api('notes/show', { noteId: id.value });
}, {
immediate: true,
});