fix(settings): fix support setting

This commit is contained in:
iOSonntag 2023-09-24 09:44:44 +02:00
parent aa89252447
commit fc4368aab5
No known key found for this signature in database
2 changed files with 1 additions and 116 deletions

View file

@ -1,115 +0,0 @@
// import { App, Plugin as ObsidianPlugin } from 'obsidian';
// import { initialSettings } from 'src/_config/initial-settings';
// import { PLUGIN_PRESETS, PluginPresetKey } from 'src/_config/presets/plugin-presets';
// import { ItemTransforms } from 'src/types/transforms';
// import { FilesFocusModeMap, Rule } from 'src/types/rules';
// import { Log } from 'src/util/logger';
// import { SettingsId, SettingsTabEvents } from 'src/core/setting-tab';
// import { ErrorHelper } from 'src/util/error-helper';
// export type PluginsSettings = {
// preset: PluginPresetKey;
// rules: Rule[];
// fileOverwrites: FilesFocusModeMap;
// transforms: ItemTransforms;
// };
// export class SettingsStore {
// app: App;
// plugin: ObsidianPlugin;
// // tabEvents: SettingsTabEvents;
// onReload: () => void;
// private settings: PluginsSettings;
// constructor(app: App, plugin: ObsidianPlugin, onReload: () => void)
// {
// this.plugin = plugin;
// this.app = app;
// this.onReload = onReload;
// // this.tabEvents = {
// // onChangeSetting: this.onChange.bind(this),
// // getCurrentSetting: this.valueBuilder.bind(this)
// // };
// }
// private onChange(id: SettingsId, value: any)
// {
// Log.log(`settings changed: ${id} = ${value}`);
// switch (id)
// {
// case 'PLUGIN_PRESET':
// this.settings.preset = value;
// break;
// }
// this.save();
// }
// private valueBuilder(id: SettingsId): any
// {
// switch (id)
// {
// case 'PLUGIN_PRESET':
// return this.settings.preset;
// }
// throw ErrorHelper.pluginBug(`Unknown settings id: ${id} - (migration needed?)`);
// }
// /**
// * Loads the settings for this plugin by merging the initial settings with the
// * current user settings if any.
// */
// async load()
// {
// Log.log('loading settings');
// let userData = await this.plugin.loadData();
// this.settings = Object.assign({}, initialSettings, userData);
// }
// /**
// * Saves the current settings to the user's vault.
// */
// async save()
// {
// Log.log('saving settings');
// await this.plugin.saveData(this.settings);
// this.onReload();
// }
// get rules(): Rule[]
// {
// if (this.settings.preset !== 'CUSTOM')
// {
// return PLUGIN_PRESETS[this.settings.preset].rules;
// }
// return this.settings.rules;
// }
// get fileOverwrites(): FilesFocusModeMap
// {
// return this.settings.fileOverwrites;
// }
// get transforms(): ItemTransforms
// {
// if (this.settings.preset !== 'CUSTOM')
// {
// return PLUGIN_PRESETS[this.settings.preset].transforms;
// }
// return this.settings.transforms;
// }
// }

View file

@ -119,7 +119,7 @@ export class SettingsView extends ObsidianSettingsTab {
context.createSectionDivider();
context.createSectionHeader('Support This Plugin', 'If you like this plugin and want to support it, you can buy me a coffee. :)');
context.createSectionHeader('Support This Plugin', 'If you like this plugin and want to support it - submit a feature request, a pull request or simply buy me a little coffee :) - Thank You.');
context.createSupportLinks('iOSonntag', 'https://paypal.com/paypalme/iOSonntag/20');
}