diff options
| author | Ekaterina Vaartis <vaartis@kotobank.ch> | 2024-01-07 14:28:34 +0300 |
|---|---|---|
| committer | Ekaterina Vaartis <vaartis@kotobank.ch> | 2024-01-07 14:28:34 +0300 |
| commit | f8e1d5e3e0600a0a113ee40787b7589b61c2654f (patch) | |
| tree | 49f30873382f3760c98db46880343663dcfecde7 /src/services/api | |
| parent | 4451cccb3c1244a179b9f5017e6a4536eb5456f1 (diff) | |
Remote pack download, localization
Diffstat (limited to 'src/services/api')
| -rw-r--r-- | src/services/api/api.service.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 5239909a..8aa209b5 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -1817,28 +1817,26 @@ const listEmojiPacks = () => { } const listRemoteEmojiPacks = ({ instance }) => { + if (!instance.startsWith('http')) { + instance = 'https://' + instance + } + return fetch( - PLEROMA_EMOJI_PACKS_LS_REMOTE_URL, + PLEROMA_EMOJI_PACKS_LS_REMOTE_URL(instance, 1, 25), { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ instance_address: instance }) + headers: { 'Content-Type': 'application/json' } } ) } const downloadRemoteEmojiPack = ({ instance, packName, as }) => { - if (as.trim() === '') { - as = null - } - return fetch( PLEROMA_EMOJI_PACKS_DL_REMOTE_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ - instance_address: instance, pack_name: packName, as + url: instance, name: packName, as }) } ) |
