diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cd013b2b..071d10f22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - Minor: Added chatter count to viewer list popout (#3261) - Minor: Added highlights for first messages (#3267) - Minor: Ignore out of bounds check for tiling wms (#3270) +- Minor: Add clear cache button to cache settings section (#3277) - Minor: Added `flags.first_message` filter variable (#3292) - Minor: Removed duplicate setting for toggling `Channel Point Redeemed Message` highlights (#3296) - Minor: Clean up chat messages of special line characters prior to sending. (#3312) diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index e4ea2680b..88caf8425 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -503,6 +503,20 @@ void GeneralPage::initLayout(GeneralPageView &layout) box->addWidget(layout.makeButton("Reset", []() { getSettings()->cachePath = ""; })); + box->addWidget(layout.makeButton("Clear Cache", [&layout]() { + auto reply = QMessageBox::question( + layout.window(), "Clear cache", + "Are you sure that you want to clear your cache? Emotes may " + "take longer to load next time Chatterino is started.", + QMessageBox::Yes | QMessageBox::No); + + if (reply == QMessageBox::Yes) + { + auto cacheDir = QDir(getPaths()->cacheDirectory()); + cacheDir.removeRecursively(); + cacheDir.mkdir(getPaths()->cacheDirectory()); + } + })); box->addStretch(1); layout.addLayout(box);