Skip to content

Commit

Permalink
feat(upload): prevent forced update (default: false)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Oct 4, 2024
1 parent e18fd2c commit b7053a2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/i18n/locales
2 changes: 2 additions & 0 deletions src/interfaces/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export const DEFAULT_SETTINGS: Partial<EnveloppeSettings> = {
charConvert: "->",
unHandledObsidianExt: [],
sendSimpleLinks: true,
forcePush: true,

},
plugin: {
shareKey: "share",
Expand Down
5 changes: 5 additions & 0 deletions src/interfaces/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ export interface Embed {
* Will apply all previous settings
*/
sendSimpleLinks: boolean;
/**
* Force the note to be uploaded even if they are not edited (and exists on repo)
* @default true
*/
forcePush?: boolean;
}

/**
Expand Down
15 changes: 14 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
await this.plugin.saveSettings();
})
);

new Setting(this.settingsPage)
.setName(i18next.t("settings.github.dryRun.enable.title"))
.setDesc(i18next.t("settings.github.dryRun.enable.desc"))
Expand Down Expand Up @@ -905,6 +906,17 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
await this.renderEmbedConfiguration();
});
});

new Setting(this.settingsPage)
.setName(i18next.t("settings.embed.forcePush.title"))
.setDesc(i18next.t("settings.embed.forcePush.desc"))
.addToggle((toggle) =>
toggle.setValue(embedSettings.forcePush ?? true).onChange(async (value) => {
embedSettings.forcePush = value;
await this.plugin.saveSettings();
})
);

this.settingsPage.createEl("h5", {
text: i18next.t("settings.embed.attachment"),
cls: "center",
Expand Down Expand Up @@ -1013,7 +1025,8 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
await this.renderEmbedConfiguration();
});
});



if (embedSettings.notes) {
new Setting(this.settingsPage)
.setName(i18next.t("settings.embed.links.title"))
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"noImplicitAny": true,
"skipLibCheck": true,
"removeComments": true,
"sourceMap": true,
"moduleResolution": "node",
"importHelpers": true,
"isolatedModules": true,
Expand Down

0 comments on commit b7053a2

Please sign in to comment.