Skip to content

Commit

Permalink
fix: 🐛 Convert setting name: Safer check + save changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Nov 22, 2021
1 parent 128f4c3 commit 7765005
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
16 changes: 3 additions & 13 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20735,14 +20735,6 @@ module.exports = __webpack_require__(/*! /home/travis/build/feathericons/feather
* This module contains various utility functions commonly used in Obsidian plugins.
* @module obsidian-community-lib
*/
/**
* You can await this Function to delay execution
*
* @param delay The delay in ms
*/
async function wait(delay) {
return new Promise((resolve) => setTimeout(resolve, delay));
}
/**
* Adds a specific Feather Icon to Obsidian.
*
Expand Down Expand Up @@ -36167,9 +36159,10 @@ class BCPlugin extends obsidian.Plugin {
console.log("loading breadcrumbs plugin");
await this.loadSettings();
// Prevent breaking change
if (this.settings.userHierarchies) {
if (this.settings.hasOwnProperty("userHierarchies")) {
this.settings.userHiers = this.settings.userHierarchies;
delete this.settings.userHierarchies;
await this.saveSettings();
}
["prev", "next"].forEach((dir) => {
this.settings.userHiers.forEach(async (hier, i) => {
Expand Down Expand Up @@ -36611,10 +36604,7 @@ class BCPlugin extends obsidian.Plugin {
? this.getDVMetadataCache(files)
: this.getObsMetadataCache(files);
if (fileFrontmatterArr[0] === undefined) {
await wait(1000);
fileFrontmatterArr = dvQ
? this.getDVMetadataCache(files)
: this.getObsMetadataCache(files);
return new graphology_umd_min.MultiGraph();
}
debugGroupStart(settings, "debugMode", "Hierarchy Note Adjacency List");
const hierarchyNotesArr = [];
Expand Down
9 changes: 3 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ export default class BCPlugin extends Plugin {
await this.loadSettings();

// Prevent breaking change

if (this.settings.userHierarchies) {
if (this.settings.hasOwnProperty("userHierarchies")) {
this.settings.userHiers = this.settings.userHierarchies;
delete this.settings.userHierarchies;
await this.saveSettings();
}

["prev", "next"].forEach((dir) => {
Expand Down Expand Up @@ -689,10 +689,7 @@ export default class BCPlugin extends Plugin {
: this.getObsMetadataCache(files);

if (fileFrontmatterArr[0] === undefined) {
await wait(1000);
fileFrontmatterArr = dvQ
? this.getDVMetadataCache(files)
: this.getObsMetadataCache(files);
return new MultiGraph();
}

debugGroupStart(settings, "debugMode", "Hierarchy Note Adjacency List");
Expand Down

0 comments on commit 7765005

Please sign in to comment.