commit
767c3dad7a
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 4.8 KiB |
@ -0,0 +1,107 @@
|
||||
[
|
||||
{
|
||||
"id": "017ed503-bc96-301a-e871-2c23b30ddd05",
|
||||
"uri": "https://mitra.social/objects/017ed503-bc96-301a-e871-2c23b30ddd05",
|
||||
"created_at": "2022-02-07T16:28:18.966874Z",
|
||||
"account": {
|
||||
"id": "017ed4f9-c121-2ae6-0805-15516cce02c3",
|
||||
"username": "alex",
|
||||
"acct": "alex",
|
||||
"url": "https://mitra.social/users/alex",
|
||||
"display_name": null,
|
||||
"created_at": "2022-02-07T16:17:24.769229Z",
|
||||
"note": null,
|
||||
"avatar": null,
|
||||
"header": null,
|
||||
"fields": [],
|
||||
"followers_count": 1,
|
||||
"following_count": 1,
|
||||
"statuses_count": 3,
|
||||
"source": null,
|
||||
"wallet_address": null
|
||||
},
|
||||
"content": "<span class=\"h-card\"><a class=\"u-url mention\" href=\"https://mitra.social/users/silverpill\">@silverpill</a></span> sup!",
|
||||
"in_reply_to_id": null,
|
||||
"reblog": null,
|
||||
"visibility": "public",
|
||||
"replies_count": 1,
|
||||
"favourites_count": 0,
|
||||
"reblogs_count": 0,
|
||||
"media_attachments": [],
|
||||
"mentions": [
|
||||
{
|
||||
"id": "dd4ebc18-269d-4c7b-a310-03d29c6ab551",
|
||||
"username": "silverpill",
|
||||
"acct": "silverpill",
|
||||
"url": "https://mitra.social/users/silverpill"
|
||||
}
|
||||
],
|
||||
"tags": [],
|
||||
"favourited": false,
|
||||
"reblogged": false,
|
||||
"ipfs_cid": null,
|
||||
"token_id": null,
|
||||
"token_tx_id": null
|
||||
},
|
||||
{
|
||||
"id": "017ed505-5926-392f-256a-f86d5075df70",
|
||||
"uri": "https://mitra.social/objects/017ed505-5926-392f-256a-f86d5075df70",
|
||||
"created_at": "2022-02-07T16:30:04.582771Z",
|
||||
"account": {
|
||||
"id": "dd4ebc18-269d-4c7b-a310-03d29c6ab551",
|
||||
"username": "silverpill",
|
||||
"acct": "silverpill",
|
||||
"url": "https://mitra.social/users/silverpill",
|
||||
"display_name": "silverpill",
|
||||
"created_at": "2021-11-06T21:08:57.441927Z",
|
||||
"note": "Admin of <a href=\"https://mitra.social/\" rel=\"noopener noreferrer\">mitra.social</a> instance. It is running experimental ActivityPub server <a href=\"https://codeberg.org/silverpill/mitra\" rel=\"noopener noreferrer\">Mitra</a>.",
|
||||
"avatar": "https://mitra.social/media/6a785bf7dd05f61c3590e8935aa49156a499ac30fd1e402f79e7e164adb36e2c.png",
|
||||
"header": null,
|
||||
"fields": [
|
||||
{
|
||||
"name": "Matrix",
|
||||
"value": "@silverpill:poa.st"
|
||||
},
|
||||
{
|
||||
"name": "Alt",
|
||||
"value": "@silverpill@poa.st"
|
||||
},
|
||||
{
|
||||
"name": "Code",
|
||||
"value": "<a href=\"https://codeberg.org/silverpill/\" rel=\"noopener noreferrer\">https://codeberg.org/silverpill/</a>"
|
||||
},
|
||||
{
|
||||
"name": "$XMR",
|
||||
"value": "884y9LmsWY7PQNsyR7bJy1dvj91tuF5spVabyCnPk4KfQtSuzFbQobTFC7xSemJgVW1FWAwnJbjTZX5zZWbBrfkv62DB62d"
|
||||
}
|
||||
],
|
||||
"followers_count": 27,
|
||||
"following_count": 15,
|
||||
"statuses_count": 110,
|
||||
"source": null,
|
||||
"wallet_address": null
|
||||
},
|
||||
"content": "<span class=\"h-card\"><a class=\"u-url mention\" href=\"https://mitra.social/users/alex\">@alex</a></span> welcome",
|
||||
"in_reply_to_id": "017ed503-bc96-301a-e871-2c23b30ddd05",
|
||||
"reblog": null,
|
||||
"visibility": "public",
|
||||
"replies_count": 0,
|
||||
"favourites_count": 1,
|
||||
"reblogs_count": 0,
|
||||
"media_attachments": [],
|
||||
"mentions": [
|
||||
{
|
||||
"id": "017ed4f9-c121-2ae6-0805-15516cce02c3",
|
||||
"username": "alex",
|
||||
"acct": "alex",
|
||||
"url": "https://mitra.social/users/alex"
|
||||
}
|
||||
],
|
||||
"tags": [],
|
||||
"favourited": true,
|
||||
"reblogged": false,
|
||||
"ipfs_cid": null,
|
||||
"token_id": null,
|
||||
"token_tx_id": null
|
||||
}
|
||||
]
|
@ -0,0 +1,95 @@
|
||||
{
|
||||
"id": "017eeb0e-e5e7-98fe-6b2b-ad02349251fb",
|
||||
"uri": "https://gleasonator.com/objects/aa5e66c9-0a10-4167-9c80-f40d9574aaec",
|
||||
"created_at": "2022-02-11T23:11:59.891770Z",
|
||||
"account": {
|
||||
"id": "8fe4d6ed-3a99-43e1-a7d4-66b4e635f756",
|
||||
"username": "alex",
|
||||
"acct": "alex@gleasonator.com",
|
||||
"url": "https://gleasonator.com/users/alex",
|
||||
"display_name": "Alex Gleason",
|
||||
"created_at": "2021-11-14T17:01:17.446307Z",
|
||||
"note": "I create Fediverse software that empowers people online.<br><br>I'm vegan btw<br><br>Note: If you have a question for me, please tag me publicly. This gives the opportunity for others to chime in, and bystanders to learn.",
|
||||
"avatar": "https://mitra.social/media/6d64aecb17348b23aaff78db4687b9476cb0da1c07cc6a819c2e6ec7144c18b1.png",
|
||||
"header": "https://mitra.social/media/bdfb009adac0e31257e9fe527d3844a7234cc71f6e06dff2bec94354639555dd.png",
|
||||
"fields": [
|
||||
{
|
||||
"name": "Website",
|
||||
"value": "<a href=\"https://alexgleason.me\" rel=\"noopener noreferrer\">https://alexgleason.me</a>"
|
||||
},
|
||||
{
|
||||
"name": "Pleroma+Soapbox",
|
||||
"value": "<a href=\"https://soapbox.pub\" rel=\"noopener noreferrer\">https://soapbox.pub</a>"
|
||||
},
|
||||
{
|
||||
"name": "Email",
|
||||
"value": "alex@alexgleason.me"
|
||||
},
|
||||
{
|
||||
"name": "Gender identity",
|
||||
"value": "Soyboy"
|
||||
},
|
||||
{
|
||||
"name": "Donate (PayPal)",
|
||||
"value": "<a href=\"https://paypal.me/gleasonator\" rel=\"noopener noreferrer\">https://paypal.me/gleasonator</a>"
|
||||
},
|
||||
{
|
||||
"name": "$BTC",
|
||||
"value": "bc1q9cx35adpm73aq2fw40ye6ts8hfxqzjr5unwg0n"
|
||||
},
|
||||
{
|
||||
"name": "$ETH",
|
||||
"value": "0xAc9aB5Fc04Dc1cB1789Af75b523Bd23C70B2D717"
|
||||
},
|
||||
{
|
||||
"name": "$DOGE",
|
||||
"value": "D5zVZs6jrRakaPVGiErkQiHt9sayzm6V5D"
|
||||
},
|
||||
{
|
||||
"name": "$XMR",
|
||||
"value": "45JDCLrjJ4bgVUSbbs2yjy9m5Mf4VLPW8fG7jw9sq5u69rXZZopQogZNeyYkMBnXpkaip4p4QwaaJNhdTotPa9g44DBCzdK"
|
||||
}
|
||||
],
|
||||
"followers_count": 2,
|
||||
"following_count": 2,
|
||||
"statuses_count": 970,
|
||||
"source": null,
|
||||
"wallet_address": null
|
||||
},
|
||||
"content": "<p>Test</p>",
|
||||
"in_reply_to_id": null,
|
||||
"reblog": null,
|
||||
"visibility": "public",
|
||||
"replies_count": 0,
|
||||
"favourites_count": 0,
|
||||
"reblogs_count": 0,
|
||||
"media_attachments": [
|
||||
{
|
||||
"id": "017eeb0e-e5df-30a4-77a7-a929145cb836",
|
||||
"type": "image",
|
||||
"url": "https://mitra.social/media/8e04e6091bbbac79641b5812508683ce72c38693661c18d16040553f2371e18d.png"
|
||||
},
|
||||
{
|
||||
"id": "017eeb0e-e5e4-2a48-2889-afdebf368a54",
|
||||
"type": "unknown",
|
||||
"url": "https://mitra.social/media/8f72dc2e98572eb4ba7c3a902bca5f69c448fc4391837e5f8f0d4556280440ac"
|
||||
},
|
||||
{
|
||||
"id": "017eeb0e-e5e5-79fd-6054-8b6869b1db49",
|
||||
"type": "unknown",
|
||||
"url": "https://mitra.social/media/55a81a090247cc4fc127e5716bcf7964f6e0df9b584f85f4696c0b994747a4d0.oga"
|
||||
},
|
||||
{
|
||||
"id": "017eeb0e-e5e6-c416-a444-21e560c47839",
|
||||
"type": "unknown",
|
||||
"url": "https://mitra.social/media/0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0"
|
||||
}
|
||||
],
|
||||
"mentions": [],
|
||||
"tags": [],
|
||||
"favourited": false,
|
||||
"reblogged": false,
|
||||
"ipfs_cid": null,
|
||||
"token_id": null,
|
||||
"token_tx_id": null
|
||||
}
|
@ -0,0 +1,238 @@
|
||||
{
|
||||
"account": {
|
||||
"acct": "alex",
|
||||
"avatar": "https://media.gleasonator.com/6d64aecb17348b23aaff78db4687b9476cb0da1c07cc6a819c2e6ec7144c18b1.png",
|
||||
"avatar_static": "https://media.gleasonator.com/6d64aecb17348b23aaff78db4687b9476cb0da1c07cc6a819c2e6ec7144c18b1.png",
|
||||
"bot": false,
|
||||
"created_at": "2020-01-08T01:25:43.000Z",
|
||||
"display_name": "Alex Gleason",
|
||||
"emojis": [],
|
||||
"fields": [
|
||||
{
|
||||
"name": "Website",
|
||||
"value": "<a href=\"https://alexgleason.me\" rel=\"ugc\">https://alexgleason.me</a>"
|
||||
},
|
||||
{
|
||||
"name": "Pleroma+Soapbox",
|
||||
"value": "<a href=\"https://soapbox.pub\" rel=\"ugc\">https://soapbox.pub</a>"
|
||||
},
|
||||
{
|
||||
"name": "Email",
|
||||
"value": "alex@alexgleason.me"
|
||||
},
|
||||
{
|
||||
"name": "Gender identity",
|
||||
"value": "Soyboy"
|
||||
},
|
||||
{
|
||||
"name": "Donate (PayPal)",
|
||||
"value": "<a href=\"https://paypal.me/gleasonator\" rel=\"ugc\">https://paypal.me/gleasonator</a>"
|
||||
},
|
||||
{
|
||||
"name": "$BTC",
|
||||
"value": "bc1q9cx35adpm73aq2fw40ye6ts8hfxqzjr5unwg0n"
|
||||
},
|
||||
{
|
||||
"name": "$ETH",
|
||||
"value": "0xAc9aB5Fc04Dc1cB1789Af75b523Bd23C70B2D717"
|
||||
},
|
||||
{
|
||||
"name": "$DOGE",
|
||||
"value": "D5zVZs6jrRakaPVGiErkQiHt9sayzm6V5D"
|
||||
},
|
||||
{
|
||||
"name": "$XMR",
|
||||
"value": "45JDCLrjJ4bgVUSbbs2yjy9m5Mf4VLPW8fG7jw9sq5u69rXZZopQogZNeyYkMBnXpkaip4p4QwaaJNhdTotPa9g44DBCzdK"
|
||||
}
|
||||
],
|
||||
"followers_count": 2344,
|
||||
"following_count": 1564,
|
||||
"fqn": "alex@gleasonator.com",
|
||||
"header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png",
|
||||
"header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png",
|
||||
"id": "9v5bmRalQvjOy0ECcC",
|
||||
"last_status_at": "2022-02-11T23:12:00",
|
||||
"locked": false,
|
||||
"note": "I create Fediverse software that empowers people online.<br/><br/>I'm vegan btw<br/><br/>Note: If you have a question for me, please tag me publicly. This gives the opportunity for others to chime in, and bystanders to learn.",
|
||||
"pleroma": {
|
||||
"accepts_chat_messages": true,
|
||||
"also_known_as": [],
|
||||
"ap_id": "https://gleasonator.com/users/alex",
|
||||
"background_image": null,
|
||||
"birthday": "1993-07-03",
|
||||
"favicon": "https://gleasonator.com/favicon.png",
|
||||
"hide_favorites": true,
|
||||
"hide_followers": false,
|
||||
"hide_followers_count": false,
|
||||
"hide_follows": false,
|
||||
"hide_follows_count": false,
|
||||
"is_admin": true,
|
||||
"is_confirmed": true,
|
||||
"is_moderator": false,
|
||||
"is_suggested": true,
|
||||
"relationship": {},
|
||||
"skip_thread_containment": false,
|
||||
"tags": []
|
||||
},
|
||||
"source": {
|
||||
"fields": [
|
||||
{
|
||||
"name": "Website",
|
||||
"value": "https://alexgleason.me"
|
||||
},
|
||||
{
|
||||
"name": "Pleroma+Soapbox",
|
||||
"value": "https://soapbox.pub"
|
||||
},
|
||||
{
|
||||
"name": "Email",
|
||||
"value": "alex@alexgleason.me"
|
||||
},
|
||||
{
|
||||
"name": "Gender identity",
|
||||
"value": "Soyboy"
|
||||
},
|
||||
{
|
||||
"name": "Donate (PayPal)",
|
||||
"value": "https://paypal.me/gleasonator"
|
||||
},
|
||||
{
|
||||
"name": "$BTC",
|
||||
"value": "bc1q9cx35adpm73aq2fw40ye6ts8hfxqzjr5unwg0n"
|
||||
},
|
||||
{
|
||||
"name": "$ETH",
|
||||
"value": "0xAc9aB5Fc04Dc1cB1789Af75b523Bd23C70B2D717"
|
||||
},
|
||||
{
|
||||
"name": "$DOGE",
|
||||
"value": "D5zVZs6jrRakaPVGiErkQiHt9sayzm6V5D"
|
||||
},
|
||||
{
|
||||
"name": "$XMR",
|
||||
"value": "45JDCLrjJ4bgVUSbbs2yjy9m5Mf4VLPW8fG7jw9sq5u69rXZZopQogZNeyYkMBnXpkaip4p4QwaaJNhdTotPa9g44DBCzdK"
|
||||
}
|
||||
],
|
||||
"note": "I create Fediverse software that empowers people online.\r\n\r\nI'm vegan btw\r\n\r\nNote: If you have a question for me, please tag me publicly. This gives the opportunity for others to chime in, and bystanders to learn.",
|
||||
"pleroma": {
|
||||
"actor_type": "Person",
|
||||
"discoverable": false
|
||||
},
|
||||
"sensitive": false
|
||||
},
|
||||
"statuses_count": 23357,
|
||||
"url": "https://gleasonator.com/users/alex",
|
||||
"username": "alex"
|
||||
},
|
||||
"application": {
|
||||
"name": "Soapbox FE",
|
||||
"website": "https://soapbox.pub/"
|
||||
},
|
||||
"bookmarked": false,
|
||||
"card": null,
|
||||
"content": "<p>Test</p>",
|
||||
"created_at": "2022-02-11T23:11:59.000Z",
|
||||
"emojis": [],
|
||||
"favourited": false,
|
||||
"favourites_count": 1,
|
||||
"id": "AGNkA21auFR5lnEAHw",
|
||||
"in_reply_to_account_id": null,
|
||||
"in_reply_to_id": null,
|
||||
"language": null,
|
||||
"media_attachments": [
|
||||
{
|
||||
"blurhash": "emLqe9t7~q%M%M-;WBt7ofRj%Moft7ofoft7ayWBj[of-;j[ayofM{",
|
||||
"description": "",
|
||||
"id": "974611173",
|
||||
"meta": {
|
||||
"original": {
|
||||
"aspect": 0.9944598337950139,
|
||||
"height": 1444,
|
||||
"width": 1436
|
||||
}
|
||||
},
|
||||
"pleroma": {
|
||||
"mime_type": "image/png"
|
||||
},
|
||||
"preview_url": "https://media.gleasonator.com/8e04e6091bbbac79641b5812508683ce72c38693661c18d16040553f2371e18d.png",
|
||||
"remote_url": "https://media.gleasonator.com/8e04e6091bbbac79641b5812508683ce72c38693661c18d16040553f2371e18d.png",
|
||||
"text_url": "https://media.gleasonator.com/8e04e6091bbbac79641b5812508683ce72c38693661c18d16040553f2371e18d.png",
|
||||
"type": "image",
|
||||
"url": "https://media.gleasonator.com/8e04e6091bbbac79641b5812508683ce72c38693661c18d16040553f2371e18d.png"
|
||||
},
|
||||
{
|
||||
"blurhash": null,
|
||||
"description": "",
|
||||
"id": "-1764036199",
|
||||
"pleroma": {
|
||||
"mime_type": "application/x-nes-rom"
|
||||
},
|
||||
"preview_url": "https://media.gleasonator.com/8f72dc2e98572eb4ba7c3a902bca5f69c448fc4391837e5f8f0d4556280440ac.nes",
|
||||
"remote_url": "https://media.gleasonator.com/8f72dc2e98572eb4ba7c3a902bca5f69c448fc4391837e5f8f0d4556280440ac.nes",
|
||||
"text_url": "https://media.gleasonator.com/8f72dc2e98572eb4ba7c3a902bca5f69c448fc4391837e5f8f0d4556280440ac.nes",
|
||||
"type": "unknown",
|
||||
"url": "https://media.gleasonator.com/8f72dc2e98572eb4ba7c3a902bca5f69c448fc4391837e5f8f0d4556280440ac.nes"
|
||||
},
|
||||
{
|
||||
"blurhash": null,
|
||||
"description": "",
|
||||
"id": "-636167741",
|
||||
"pleroma": {
|
||||
"mime_type": "audio/ogg"
|
||||
},
|
||||
"preview_url": "https://media.gleasonator.com/55a81a090247cc4fc127e5716bcf7964f6e0df9b584f85f4696c0b994747a4d0.ogg",
|
||||
"remote_url": "https://media.gleasonator.com/55a81a090247cc4fc127e5716bcf7964f6e0df9b584f85f4696c0b994747a4d0.ogg",
|
||||
"text_url": "https://media.gleasonator.com/55a81a090247cc4fc127e5716bcf7964f6e0df9b584f85f4696c0b994747a4d0.ogg",
|
||||
"type": "audio",
|
||||
"url": "https://media.gleasonator.com/55a81a090247cc4fc127e5716bcf7964f6e0df9b584f85f4696c0b994747a4d0.ogg"
|
||||
},
|
||||
{
|
||||
"blurhash": null,
|
||||
"description": "",
|
||||
"id": "517941208",
|
||||
"pleroma": {
|
||||
"mime_type": "text/plain"
|
||||
},
|
||||
"preview_url": "https://media.gleasonator.com/0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0.LICENSE",
|
||||
"remote_url": "https://media.gleasonator.com/0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0.LICENSE",
|
||||
"text_url": "https://media.gleasonator.com/0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0.LICENSE",
|
||||
"type": "unknown",
|
||||
"url": "https://media.gleasonator.com/0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0.LICENSE"
|
||||
}
|
||||
],
|
||||
"mentions": [],
|
||||
"muted": false,
|
||||
"pinned": false,
|
||||
"pleroma": {
|
||||
"content": {
|
||||
"text/plain": "Test"
|
||||
},
|
||||
"conversation_id": "AGNkA1yP66srbtjcJc",
|
||||
"direct_conversation_id": null,
|
||||
"emoji_reactions": [],
|
||||
"expires_at": null,
|
||||
"in_reply_to_account_acct": null,
|
||||
"local": true,
|
||||
"parent_visible": false,
|
||||
"pinned_at": null,
|
||||
"quote": null,
|
||||
"quote_url": null,
|
||||
"quote_visible": false,
|
||||
"spoiler_text": {
|
||||
"text/plain": ""
|
||||
},
|
||||
"thread_muted": false
|
||||
},
|
||||
"poll": null,
|
||||
"reblog": null,
|
||||
"reblogged": false,
|
||||
"reblogs_count": 0,
|
||||
"replies_count": 0,
|
||||
"sensitive": false,
|
||||
"spoiler_text": "",
|
||||
"tags": [],
|
||||
"text": null,
|
||||
"uri": "https://gleasonator.com/objects/aa5e66c9-0a10-4167-9c80-f40d9574aaec",
|
||||
"url": "https://gleasonator.com/notice/AGNkA21auFR5lnEAHw",
|
||||
"visibility": "public"
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
import { Map as ImmutableMap } from 'immutable';
|
||||
|
||||
import { STATUSES_IMPORT } from 'soapbox/actions/importer';
|
||||
import { __stub } from 'soapbox/api';
|
||||
import { mockStore } from 'soapbox/test_helpers';
|
||||
|
||||
import { fetchContext } from '../statuses';
|
||||
|
||||
describe('fetchContext()', () => {
|
||||
it('handles Mitra context', done => {
|
||||
const statuses = require('soapbox/__fixtures__/mitra-context.json');
|
||||
|
||||
__stub(mock => {
|
||||
mock.onGet('/api/v1/statuses/017ed505-5926-392f-256a-f86d5075df70/context')
|
||||
.reply(200, statuses);
|
||||
});
|
||||
|
||||
const store = mockStore(ImmutableMap());
|
||||
|
||||
store.dispatch(fetchContext('017ed505-5926-392f-256a-f86d5075df70')).then(context => {
|
||||
const actions = store.getActions();
|
||||
|
||||
expect(actions[3].type).toEqual(STATUSES_IMPORT);
|
||||
expect(actions[3].statuses[0].id).toEqual('017ed503-bc96-301a-e871-2c23b30ddd05');
|
||||
|
||||
done();
|
||||
}).catch(console.error);
|
||||
});
|
||||
});
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,26 @@
|
||||
export const ethereum = () => window.ethereum;
|
||||
|
||||
export const hasEthereum = () => Boolean(ethereum());
|
||||
|
||||
// Requests an Ethereum wallet from the browser
|
||||
// Returns a Promise containing the Ethereum wallet address (string).
|
||||
export const getWallet = () => {
|
||||
return ethereum().request({ method: 'eth_requestAccounts' })
|
||||
.then(wallets => wallets[0]);
|
||||
};
|
||||
|
||||
// Asks the browser to sign a message with Ethereum.
|
||||
// Returns a Promise containing the signature (string).
|
||||
export const signMessage = (wallet, message) => {
|
||||
return ethereum().request({ method: 'personal_sign', params: [message, wallet] });
|
||||
};
|
||||
|
||||
// Combines the above functions.
|
||||
// Returns an object with the `wallet` and `signature`
|
||||
export const getWalletAndSign = message => {
|
||||
return getWallet().then(wallet => {
|
||||
return signMessage(wallet, message).then(signature => {
|
||||
return { wallet, signature };
|
||||
});
|
||||
});
|
||||
};
|
@ -1,12 +1,17 @@
|
||||
import { parseVersion } from './features';
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
import { parseVersion, PLEROMA, MITRA } from './features';
|
||||
|
||||
// For solving bugs between API implementations
|
||||
export const getQuirks = instance => {
|
||||
const v = parseVersion(instance.get('version'));
|
||||
export const getQuirks = createSelector([
|
||||
instance => parseVersion(instance.get('version')),
|
||||
], (v) => {
|
||||
return {
|
||||
invertedPagination: v.software === 'Pleroma',
|
||||
invertedPagination: v.software === PLEROMA,
|
||||
noApps: v.software === MITRA,
|
||||
noOAuthForm: v.software === MITRA,
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
export const getNextLinkName = getState =>
|
||||
getQuirks(getState().get('instance')).invertedPagination ? 'prev' : 'next';
|
||||
|
Loading…
Reference in new issue