mirror of
https://github.com/decaf-dev/obsidian-vault-explorer.git
synced 2026-07-22 10:10:31 +00:00
feat: save plugin version
This commit is contained in:
parent
a8e066aace
commit
ec2bc8b7cd
3 changed files with 14 additions and 5 deletions
|
|
@ -33,5 +33,6 @@ export const DEFAULT_SETTINGS: VaultExplorerPluginSettings = {
|
|||
}
|
||||
},
|
||||
currentView: "grid",
|
||||
pageSize: 50
|
||||
pageSize: 50,
|
||||
pluginVersion: null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,14 @@ export default class VaultExplorerPlugin extends Plugin {
|
|||
|
||||
async loadSettings() {
|
||||
const data = await this.loadData();
|
||||
|
||||
this.settings = Object.assign({}, DEFAULT_SETTINGS, data);
|
||||
|
||||
//TODO handle migrations
|
||||
// if (this.settings.pluginVersion === null) {
|
||||
this.settings.pluginVersion = this.manifest.version;
|
||||
await this.saveSettings();
|
||||
// }
|
||||
}
|
||||
|
||||
async saveSettings() {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ export interface VaultExplorerPluginSettings {
|
|||
},
|
||||
currentView: CurrentView;
|
||||
pageSize: number;
|
||||
pluginVersion: string | null;
|
||||
}
|
||||
|
||||
export interface CustomProperty {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface TextPropertyFilter extends BasePropertyFilter {
|
||||
|
|
@ -63,7 +68,3 @@ export type CurrentView = "grid" | "list";
|
|||
export type SortFilter = "file-name-asc" | "file-name-desc" | "modified-asc" | "modified-desc";
|
||||
|
||||
export type TimestampFilter = "created-today" | "modified-today" | "created-this-week" | "modified-this-week" | "created-2-weeks" | "modified-2-weeks" | "all";
|
||||
|
||||
export type onSettingsChange = (value: VaultExplorerPluginSettings) => void;
|
||||
|
||||
export type getCurrentSettings = () => VaultExplorerPluginSettings;
|
||||
|
|
|
|||
Loading…
Reference in a new issue