Skip to content
Snippets Groups Projects
Commit e541bc48 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

file-handling: fix a dep cycle

FileHandlingClipboard and FileSink depend on each other. Register
the later at runtime so we don't get a dependecy cycle for imports.
parent c664e298
No related branches found
No related tags found
1 merge request!43file-handling: fix a dep cycle
Pipeline #25195 passed
...@@ -11,7 +11,6 @@ import {classMap} from 'lit-html/directives/class-map.js'; ...@@ -11,7 +11,6 @@ import {classMap} from 'lit-html/directives/class-map.js';
import * as commonUtils from "@dbp-toolkit/common/utils"; import * as commonUtils from "@dbp-toolkit/common/utils";
import {name as pkgName} from "../package.json"; import {name as pkgName} from "../package.json";
import {send} from "@dbp-toolkit/common/notification"; import {send} from "@dbp-toolkit/common/notification";
import {FileSink} from "./file-sink";
/** /**
...@@ -39,13 +38,14 @@ export class FileHandlingClipboard extends ScopedElementsMixin(DBPLitElement) { ...@@ -39,13 +38,14 @@ export class FileHandlingClipboard extends ScopedElementsMixin(DBPLitElement) {
this.nextcloudPath = ''; this.nextcloudPath = '';
this.nextcloudFileURL = ''; this.nextcloudFileURL = '';
// To avoid a cyclic dependency
import('./file-sink').then(({ FileSink }) => this.defineScopedElement('dbp-file-sink', FileSink));
} }
static get scopedElements() { static get scopedElements() {
return { return {
'dbp-icon': Icon, 'dbp-icon': Icon,
'dbp-mini-spinner': MiniSpinner, 'dbp-mini-spinner': MiniSpinner,
'dbp-file-sink': FileSink,
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment