Skip to content

Commit

Permalink
bring blob message decoding helper method over to observable flow
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmcgaw committed Mar 2, 2023
1 parent 9aa3e08 commit cae3b4f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/store/epics/chatEpics.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ import ChatHandler from './helpers/ChatHandler';
import { combineEpics } from 'redux-observable';
import createDetectVisibilityObservable from './helpers/createDetectPageVisibilityObservable';

// let wsUrl = `${window.location.origin.replace('http', 'ws')}/api/ws/messages/all`;
// if (Capacitor.isNativePlatform()) {
// // wsUrl = 'wss://www.leapchat.org/api/ws/messages/all'
// wsUrl = 'ws://10.0.2.2:8080/api/ws/messages/all'
// }

import { authUrl, wsUrl } from './helpers/urls';

export const chatHandler = new ChatHandler(wsUrl);
Expand Down Expand Up @@ -130,6 +124,12 @@ function getAuthRequestSettings({ mID }) {
return settings;
}

// Helper for parsing response from Go API
//
// From https://stackoverflow.com/a/36183085
const b64toBlob = (base64, type = 'application/octet-stream') =>
fetch(`data:${type};base64,${base64}`).then(res => res.blob());

const connectionAlertTtlSeconds = 4;

const initConnectionEpic = (action$) =>
Expand Down

0 comments on commit cae3b4f

Please sign in to comment.