@@ -27,8 +27,6 @@ import { initializeSupabaseSync } from "~/utils/syncDgNodesToSupabase";
2727import { FileChangeListener } from "~/utils/fileChangeListener" ;
2828import generateUid from "~/utils/generateUid" ;
2929import { migrateFrontmatterRelationsToRelationsJson } from "~/utils/relationsStore" ;
30- import { collectDiscourseNodesFromVault } from "~/utils/getDiscourseNodes" ;
31- import { spaceUriAndLocalIdToRid } from "~/utils/rid" ;
3230
3331export default class DiscourseGraphPlugin extends Plugin {
3432 settings : Settings = { ...DEFAULT_SETTINGS } ;
@@ -45,10 +43,6 @@ export default class DiscourseGraphPlugin extends Plugin {
4543 console . error ( "Failed to migrate frontmatter relations:" , error ) ;
4644 } ) ;
4745
48- await this . migrateImportedFromFrontMatter ( ) . catch ( ( error ) => {
49- console . error ( "Failed to migrate frontmatter:" , error ) ;
50- } ) ;
51-
5246 if ( this . settings . syncModeEnabled === true ) {
5347 void initializeSupabaseSync ( this ) . catch ( ( error ) => {
5448 console . error ( "Failed to initialize Supabase sync:" , error ) ;
@@ -401,35 +395,6 @@ export default class DiscourseGraphPlugin extends Plugin {
401395 this . currentViewActions = [ ] ;
402396 }
403397
404- async migrateImportedFromFrontMatter ( ) {
405- const nodes = await collectDiscourseNodesFromVault ( this , true ) ;
406- for ( const node of nodes ) {
407- if ( typeof node . frontmatter . importedFromSpaceUri === "string" ) {
408- await this . app . fileManager . processFrontMatter (
409- node . file ,
410- ( frontmatter : Record < string , unknown > ) => {
411- const spaceUri = frontmatter . importedFromSpaceUri as string ;
412- // note: we fortunately reused the original Id here.
413- const nodeId = frontmatter . nodeInstanceId ;
414- if ( typeof nodeId !== "string" ) {
415- console . error (
416- `error: missing nodeInstanceId on node ${ node . file . path } ` ,
417- ) ;
418- return ;
419- }
420- try {
421- const rid = spaceUriAndLocalIdToRid ( spaceUri , nodeId , "note" ) ;
422- frontmatter . importedFromRid = rid ;
423- delete frontmatter . importedFromSpaceUri ;
424- } catch ( error ) {
425- console . error ( error ) ;
426- }
427- } ,
428- ) ;
429- }
430- }
431- }
432-
433398 async onunload ( ) {
434399 this . cleanupViewActions ( ) ;
435400 if ( this . styleElement ) {
0 commit comments