mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-07-13 12:38:02 +00:00
Polish mobile UI and editor workflows
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
const API_BASE = window.location.origin;
|
||||
|
||||
export function emailAccountQuery(prefix = '&') {
|
||||
const accountId = window.__odysseusActiveEmailAccount || '';
|
||||
if (!accountId) return '';
|
||||
const lead = prefix === '?' ? '?' : '&';
|
||||
return `${lead}account_id=${encodeURIComponent(accountId)}`;
|
||||
}
|
||||
|
||||
export function emailApiUrl(path, params = {}) {
|
||||
const url = new URL(`${API_BASE}${path}`);
|
||||
const accountId = window.__odysseusActiveEmailAccount || '';
|
||||
if (accountId) url.searchParams.set('account_id', accountId);
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value === undefined || value === null || value === '') return;
|
||||
url.searchParams.set(key, String(value));
|
||||
});
|
||||
return url.toString();
|
||||
}
|
||||
Reference in New Issue
Block a user