diff --git a/src/apis/connect.ts b/src/apis/connect.ts index a9c5c800d83..3d9dc197818 100644 --- a/src/apis/connect.ts +++ b/src/apis/connect.ts @@ -53,7 +53,7 @@ export async function open( /** * Update the guest name * @param guestName the name to use for the local user - * @param connection connection to close + * @param connection connection to update the guest name for */ export async function update( guestName: string, diff --git a/src/components/Editor.singleton.js b/src/components/Editor.singleton.js deleted file mode 100644 index 458898fde31..00000000000 --- a/src/components/Editor.singleton.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Get instance of Editor component - * Using singleton approach here to avoid duplicate yjs import error - * @return {Promise<*>} - */ -export default async function getEditorInstance() { - if (!window._nc_text_editor_instance) { - if (window._nc_text_editor_importing) { - return await new Promise((resolve) => { - const intervalId = setInterval(() => { - if (!window._nc_text_editor_instance) { - return - } - resolve(window._nc_text_editor_instance) - clearInterval(intervalId) - }, 200) - }) - } else { - window._nc_text_editor_importing = true - } - const Editor = await import(/* webpackChunkName: "editor" */ './Editor.vue') - const { default: Vue } = await import('vue') - const EditorConstructor = Vue.extend(Editor.default) - window._nc_text_editor_instance = EditorConstructor - } - return window._nc_text_editor_instance -} diff --git a/src/components/ViewerComponent.vue b/src/components/ViewerComponent.vue index d7a9837d185..bb1056bdf27 100644 --- a/src/components/ViewerComponent.vue +++ b/src/components/ViewerComponent.vue @@ -40,27 +40,27 @@ import { getClient, getRootPath } from '@nextcloud/files/dav' import { t } from '@nextcloud/l10n' import { getSharingToken } from '@nextcloud/sharing/public' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' -import Vue from 'vue' +import { defineComponent } from 'vue' import PencilOutlineIcon from 'vue-material-design-icons/PencilOutline.vue' +import Editor from './Editor.vue' import MarkdownContentEditor from './Editor/MarkdownContentEditor.vue' import PlainTextReader from './PlainTextReader.vue' -import getEditorInstance from './Editor.singleton.js' - -export default { +export default defineComponent({ name: 'ViewerComponent', components: { - NcButton: Vue.extend(NcButton), - PencilOutlineIcon: Vue.extend(PencilOutlineIcon), - PlainTextReader: Vue.extend(PlainTextReader), - MarkdownContentEditor: Vue.extend(MarkdownContentEditor), - Editor: getEditorInstance, + NcButton, + PencilOutlineIcon, + PlainTextReader, + MarkdownContentEditor, + Editor, }, provide() { return { isEmbedded: this.isEmbedded, } }, + inheritAttrs: false, props: { filename: { type: String, @@ -86,14 +86,6 @@ export default { type: String, default: null, }, - showOutlineOutside: { - type: Boolean, - default: false, - }, - permissions: { - type: String, - default: '', - }, source: { type: String, default: undefined, @@ -184,7 +176,7 @@ export default { }, t, }, -} +})