mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-05 13:35:20 +00:00
fix(dashboard): refresh the Usage tab when the subscription changes
An upgrade from the Usage tab's own button, or a return from the billing portal, refreshed Home behind it while the Usage meter and plan button kept the old allowance until the user left the tab and came back. Usage now handles puter:subscription:changed while it is showing.
This commit is contained in:
1 parent
bb74a2e8de
commit
dc9ce4fffd
1 file changed
+9
@@ -97,6 +97,15 @@ const TabUsage = {
|
||||
|
||||
refreshUsageDetails($el_window);
|
||||
|
||||
// An upgrade, a plan change, or a return from the billing portal (see
|
||||
// TabHome) changes the allowance and the button shown here. Hidden,
|
||||
// the tab refreshes on its next activation instead.
|
||||
window.addEventListener('puter:subscription:changed', () => {
|
||||
if ( ! $($el_window).find('.dashboard-section-usage').hasClass('active') ) return;
|
||||
setupPlanButton($el_window);
|
||||
refreshUsageDetails($el_window);
|
||||
});
|
||||
|
||||
// Click handler for sortable table headers
|
||||
$($el_window).on('click', '.driver-usage-details-content-table th[data-sort]', function () {
|
||||
const column = $(this).data('sort');
|
||||
|
||||
Reference in new issue
Block a user