@@ -14,17 +14,13 @@ import {
1414} from "src/logger/constants" ;
1515import Logger from "js-logger" ;
1616import { stringToLogLevel } from "src/logger" ;
17- import {
18- CollapseStyle ,
19- CoverImageSource ,
20- FileInteractionStyle ,
21- TExplorerView ,
22- } from "src/types" ;
17+ import { CollapseStyle , CoverImageSource , TExplorerView } from "src/types" ;
2318import EventManager from "src/event/event-manager" ;
2419import LicenseKeyApp from "../svelte/license-key-app/index.svelte" ;
2520import { PluginEvent } from "src/event/types" ;
2621
2722import "./styles.css" ;
23+ import { clearSocialImageCache } from "src/svelte/app/services/social-media-image" ;
2824
2925export default class VaultExplorerSettingsTab extends PluginSettingTab {
3026 plugin : VaultExplorerPlugin ;
@@ -653,29 +649,6 @@ export default class VaultExplorerSettingsTab extends PluginSettingTab {
653649 target : containerEl ,
654650 } ) ;
655651
656- new Setting ( containerEl ) . setName ( "Storage" ) . setHeading ( ) ;
657-
658- const configFolderDesc = new DocumentFragment ( ) ;
659- configFolderDesc . createDiv ( {
660- text : "Set the plugin configuration folder." ,
661- } ) ;
662- configFolderDesc . createDiv ( {
663- text : "Restart Obsidian after changing this setting." ,
664- cls : "mod-warning" ,
665- } ) ;
666-
667- new Setting ( containerEl )
668- . setName ( "Config folder" )
669- . setDesc ( configFolderDesc )
670- . addText ( ( component ) =>
671- component
672- . setValue ( this . plugin . settings . configDir )
673- . onChange ( async ( value ) => {
674- this . plugin . settings . configDir = value ;
675- await this . plugin . saveSettings ( ) ;
676- } )
677- ) ;
678-
679652 new Setting ( containerEl ) . setName ( "Debugging" ) . setHeading ( ) ;
680653 new Setting ( containerEl )
681654 . setName ( "Log level" )
@@ -699,6 +672,40 @@ export default class VaultExplorerSettingsTab extends PluginSettingTab {
699672 }
700673 ) ;
701674 } ) ;
675+
676+ new Setting ( containerEl ) . setName ( "Data" ) . setHeading ( ) ;
677+
678+ const configFolderDesc = new DocumentFragment ( ) ;
679+ configFolderDesc . createDiv ( {
680+ text : "Set the plugin configuration folder." ,
681+ } ) ;
682+ configFolderDesc . createDiv ( {
683+ text : "Restart Obsidian after changing this setting." ,
684+ cls : "mod-warning vault-explorer-setting-description" ,
685+ } ) ;
686+
687+ new Setting ( containerEl )
688+ . setName ( "Config folder" )
689+ . setDesc ( configFolderDesc )
690+ . addText ( ( component ) =>
691+ component
692+ . setValue ( this . plugin . settings . configDir )
693+ . onChange ( async ( value ) => {
694+ this . plugin . settings . configDir = value ;
695+ await this . plugin . saveSettings ( ) ;
696+ } )
697+ ) ;
698+
699+ new Setting ( containerEl )
700+ . setName ( "Social media image cache" )
701+ . addButton ( ( button ) =>
702+ button
703+ . setClass ( "mod-destructive" )
704+ . setButtonText ( "Clear cache" )
705+ . onClick ( async ( ) => {
706+ await clearSocialImageCache ( ) ;
707+ } )
708+ ) ;
702709 }
703710
704711 onClose ( ) {
0 commit comments