Skip to content

Commit

Permalink
feat(settings): browse for file location. closes #16
Browse files Browse the repository at this point in the history
feat: cosmetic update to the text of the action command in app
  • Loading branch information
manuerwin committed Jul 19, 2023
1 parent 0feb0b7 commit e2c06fb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/replaceResourcesSetup.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import joplin from "api";
import { SettingItemType } from "api/types";
import { SettingItemType, SettingItemSubType } from "api/types";
import { MenuItemLocation } from "api/types";
import { createResources, deleteResources } from "./replaceResources";

export async function registerSettings(): Promise<void> {
await joplin.settings.registerSection("AttachéSection", {
label: "Attaché",
iconName: "fas fa-exchange-alt",
description: "Choose the location of files that will replace your resources. Restarting Joplin will create this if doesn't exist.",
});

await joplin.settings.registerSettings({
filesPath: {
value: "",
type: SettingItemType.String,
subType: SettingItemSubType.DirectoryPath,
section: "AttachéSection",
public: true,
label: "Files Path",
description: "Path to files that will replace your resources. Restarting Joplin will create this path if doesn't exist.",
label: "",
},
});

Expand All @@ -35,7 +36,7 @@ export async function registerSettings(): Promise<void> {
export async function registerCommand(): Promise<void> {
await joplin.commands.register({
name: "Attaché",
label: "Replace/update attachments",
label: "Attaché - replace/update attachments",
execute: async () => {
await deleteResources();
}
Expand All @@ -44,7 +45,7 @@ export async function registerCommand(): Promise<void> {

export async function onSyncCompleteEvent(): Promise<void> {
joplin.workspace.onSyncComplete(async (event: any) => {
console.debug(`onSyncComplete event has occurred, about to call createResources`);
console.debug(`##DEBUG: onSyncComplete event has occurred, about to call createResources`);
await createResources();
});
}
Expand Down

0 comments on commit e2c06fb

Please sign in to comment.