Skip to content

Commit

Permalink
fix: 🐛 Don't overwrite userHiers everytime
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Nov 23, 2021
1 parent 30e5bfa commit 231a042
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export interface BCSettings {
trailSeperator: string;
useAllMetadata: boolean;
userHiers: UserHier[];
userHierarchies: UserHier[];
visGraph: visTypes;
visRelation: Relations;
visClosed: string;
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ export default class BCPlugin extends Plugin {
await this.loadSettings();

// Prevent breaking change
if (this.settings.hasOwnProperty("userHierarchies")) {
this.settings.userHiers = this.settings.userHierarchies;
const { userHierarchies } = this.settings;
if (userHierarchies !== undefined && userHierarchies.length > 0) {
this.settings.userHiers = userHierarchies;
delete this.settings.userHierarchies;
await this.saveSettings();
}
Expand Down

0 comments on commit 231a042

Please sign in to comment.