feat(users): normalize center routes and withdrawal limits
This commit is contained in:
@@ -124,16 +124,17 @@
|
||||
}
|
||||
|
||||
function tabFromUrl() {
|
||||
var m = window.location.search.match(/[?&]tab=([^&]+)/);
|
||||
var name = m ? decodeURIComponent(m[1]) : (cfg.activeTab || defaultTab);
|
||||
var pathParts = window.location.pathname.replace(/\/+$/, '').split('/');
|
||||
var pathTab = pathParts.length > 2 && pathParts[pathParts.length - 2] === 'user' ? pathParts[pathParts.length - 1] : '';
|
||||
var name = pathTab || (cfg.activeTab || defaultTab);
|
||||
if (name === 'balance') name = 'credits';
|
||||
return tabAliases[name] || name;
|
||||
}
|
||||
|
||||
function updateUrl(name) {
|
||||
if (!window.history.replaceState) return;
|
||||
var u = new URL(window.location);
|
||||
if (name === defaultTab) u.searchParams.delete('tab');
|
||||
else u.searchParams.set('tab', name);
|
||||
var pathTab = name === 'credits' ? 'balance' : name;
|
||||
var u = new URL('/user/' + pathTab + '/', window.location.origin);
|
||||
window.history.replaceState({}, '', u);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user