From f3ee0c503344d3f17e4348fa316e1d1cee56f879 Mon Sep 17 00:00:00 2001 From: Samuel Date: Tue, 12 Dec 2023 17:12:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DAlbum=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=97=A0=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/widget/Album/index.js | 2 +- scripts/widget/Album/setting.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/widget/Album/index.js b/scripts/widget/Album/index.js index e686d03..44597fb 100644 --- a/scripts/widget/Album/index.js +++ b/scripts/widget/Album/index.js @@ -4,7 +4,7 @@ const PictureSetting = require("./setting") class PictureWidget extends Widget { constructor(kernel) { super(kernel, new PictureSetting(kernel)) - this.cacheKey = "switch.data" + this.setting.config.name ?? "" + this.cacheKey = this.setting.cacheKey this.album = this.setting.album this.albumPath = this.album.albumPath this.imageSwitchMethod = this.setting.get("imageSwitchMethod") diff --git a/scripts/widget/Album/setting.js b/scripts/widget/Album/setting.js index fe5bd35..99c6e5b 100644 --- a/scripts/widget/Album/setting.js +++ b/scripts/widget/Album/setting.js @@ -6,6 +6,7 @@ const { UIKit } = require("../../libs/easy-jsbox") class PictureSetting extends WidgetSetting { constructor(kernel) { super(kernel, NAME) + this.cacheKey = "switch.data" + this.config.name ?? "" this.album = new Album(this.kernel, this) } @@ -22,7 +23,7 @@ class PictureSetting extends WidgetSetting { this.setting.method.clearCache = animate => { animate.start() - $cache.remove("switch.data") + $cache.remove(this.cacheKey) animate.done() } }