discourse/app/assets/javascripts/admin/addon/controllers/admin-whats-new.js
Martin Brennan 2ef9d6ac47
FEATURE: Allow admins to force refresh "What's new?" (#29911)
Sometimes changes to "What's new?" feed items are made or the feed items are
removed altogether, and the polling interval to check for new features is 1 day.

This is quite long, so this commit introduces a "Check for updates"
button for admins to click on the "What's new?" page which will bust
the cache for the feed and check again at the new features endpoint.
This is limited to 5 times per minute to avoid rapid sending of
requests.
2024-11-27 09:40:55 +10:00

15 lines
363 B
JavaScript

import Controller from "@ember/controller";
import { action } from "@ember/object";
export default class AdminWhatsNewController extends Controller {
@action
checkForUpdates() {
this.checkFeaturesCallback?.({ forceRefresh: true });
}
@action
bindCheckFeatures(checkFeaturesCallback) {
this.checkFeaturesCallback = checkFeaturesCallback;
}
}