feat: merge promotion and earnings center
This commit is contained in:
1 parent
f70eca09d1
commit
6dbb556d60
11 files changed
+65
-87
No files matched your search
@@ -144,7 +144,7 @@
|
||||
function reloadRevenuePanel() {
|
||||
var current = document.querySelector('[data-aksrt-revenue-page]');
|
||||
if (!current) return Promise.resolve();
|
||||
var panelUrl = rest + '/user-center/panel/revenue';
|
||||
var panelUrl = rest + '/user-center/panel/promotion';
|
||||
var query = new URL(window.location.href).searchParams;
|
||||
query.delete('tab');
|
||||
panelUrl += '?' + query.toString();
|
||||
@@ -171,7 +171,7 @@
|
||||
link.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
var targetUrl = new URL(link.href, window.location.href);
|
||||
var panelUrl = rest + '/user-center/panel/revenue?' + targetUrl.searchParams.toString();
|
||||
var panelUrl = rest + '/user-center/panel/promotion?' + targetUrl.searchParams.toString();
|
||||
fetch(panelUrl, {
|
||||
credentials: 'same-origin',
|
||||
headers: { 'X-WP-Nonce': data.restNonce || data.nonce || '' }
|
||||
@@ -187,6 +187,7 @@
|
||||
current.replaceWith(next);
|
||||
window.history.pushState({}, '', targetUrl);
|
||||
window.AKSRTRevenueCenterInit(next);
|
||||
if (typeof window.AKSRTAffiliatePromotionInit === 'function') window.AKSRTAffiliatePromotionInit();
|
||||
if (typeof window.AKSRTWithdrawInit === 'function') window.AKSRTWithdrawInit();
|
||||
});
|
||||
}).catch(function () {
|
||||
|
||||
Reference in new issue
Block a user