Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
HyeonseoNam committed Mar 20, 2023
1 parent 05f2db0 commit df838bc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,11 @@ export default class AutoClassifierPlugin extends Plugin {
loadingIcon.addClass('loading-icon');
const loadingText = document.createElement('span');
loadingText.textContent = text;

//@ts-ignore
notice.noticeEl.empty();
loadingContainer.appendChild(loadingIcon);
loadingContainer.appendChild(loadingText);
//@ts-ignore
notice.noticeEl.appendChild(loadingContainer);

return notice;
Expand Down
22 changes: 11 additions & 11 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ Assign your own shortcuts to run commands for different input types.`
.setDesc('Choose the type of reference tag')
.addDropdown((dropdown) => {
dropdown
.addOption(ReferenceType.All, "All tags")
.addOption(ReferenceType.Filter, "Filtered tags",)
.addOption(ReferenceType.Manual, "Manual tags")
.setValue(commandOption.refType)
.addOption(String(ReferenceType.All), "All tags")
.addOption(String(ReferenceType.Filter), "Filtered tags",)
.addOption(String(ReferenceType.Manual), "Manual tags")
.setValue(String(commandOption.refType))
.onChange(async (refTye) => {
this.setRefType(refTye);
this.setRefs(refTye);
this.setRefType(parseInt(refTye));
this.setRefs(parseInt(refTye));
this.display();
});
});
Expand Down Expand Up @@ -225,12 +225,12 @@ Assign your own shortcuts to run commands for different input types.`
.setName('Output Tag Location')
.setDesc('Specify where to put the output tag')
.addDropdown((cb) => {
cb.addOption(OutLocation.FrontMatter, 'FrontMatter')
.addOption(OutLocation.Title, 'Title alternative')
.addOption(OutLocation.Cursor, 'Current cursor')
.setValue(commandOption.outLocation)
cb.addOption(String(OutLocation.FrontMatter), 'FrontMatter')
.addOption(String(OutLocation.Title), 'Title alternative')
.addOption(String(OutLocation.Cursor), 'Current cursor')
.setValue(String(commandOption.outLocation))
.onChange(async (value) => {
commandOption.outLocation = value;
commandOption.outLocation = parseInt(value);
await this.plugin.saveSettings();
this.display();
});
Expand Down
6 changes: 4 additions & 2 deletions src/view-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export class ViewManager {
const activeView = this.app.workspace.getActiveViewOfType(MarkdownView);
if (activeView) {
const file = activeView.file;
const frontmatter: FrontMatterCache | undefined = this.app.metadataCache.getFileCache(file)?.frontmatter;
if (frontmatter && frontmatter.hasOwnProperty('position')) {
const frontmatter = this.app.metadataCache.getFileCache(file)?.frontmatter as Partial<FrontMatterCache>;
if (frontmatter?.position) {
delete frontmatter.position;
}
return JSON.stringify(frontmatter);
Expand All @@ -55,6 +55,7 @@ export class ViewManager {
}

async getTags(filterRegex?: string): Promise<string[] | null> {
//@ts-ignore
const tagsDict = this.app.metadataCache.getTags();
let tags = Object.keys(tagsDict);
if (!tags || tags.length == 0) return null;
Expand Down Expand Up @@ -92,6 +93,7 @@ export class ViewManager {

async insertAtTitle(value: string, overwrite = false): Promise<void> {
const file = this.app.workspace.getActiveFile();
if (!file) return;
let newName = file.basename;
if (overwrite) {
newName = `${value}`;
Expand Down

0 comments on commit df838bc

Please sign in to comment.