about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/actions
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-05-10 13:04:55 +0200
committerThibaut Girka <thib@sitedethib.com>2018-05-10 14:11:23 +0200
commitf6ec8c48210f6bce421d0d7248737d028ae88ee3 (patch)
tree184de738f4084a55c1798321b0b41ff37efe2517 /app/javascript/flavours/glitch/actions
parent34142ab29c33104793afe3199f102d84b83b9b57 (diff)
[Glitch] Use plaintext value for field value tooltips in web UI
Port d185f3ddafc941e280de7efc6d448449ab5ce2c9 to glitch-soc

This doesn't change anything for glitch-style fields, but those will go
away eventually
Diffstat (limited to 'app/javascript/flavours/glitch/actions')
-rw-r--r--app/javascript/flavours/glitch/actions/notifications.js8
1 files changed, 1 insertions, 7 deletions
diff --git a/app/javascript/flavours/glitch/actions/notifications.js b/app/javascript/flavours/glitch/actions/notifications.js
index cf27eff90..0d52100b9 100644
--- a/app/javascript/flavours/glitch/actions/notifications.js
+++ b/app/javascript/flavours/glitch/actions/notifications.js
@@ -3,6 +3,7 @@ import { List as ImmutableList } from 'immutable';
 import IntlMessageFormat from 'intl-messageformat';
 import { fetchRelationships } from './accounts';
 import { defineMessages } from 'react-intl';
+import { unescapeHTML } from 'flavours/glitch/util/html';
 
 export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
 
@@ -40,13 +41,6 @@ const fetchRelatedRelationships = (dispatch, notifications) => {
   }
 };
 
-const unescapeHTML = (html) => {
-  const wrapper = document.createElement('div');
-  html = html.replace(/<br \/>|<br>|\n/g, ' ');
-  wrapper.innerHTML = html;
-  return wrapper.textContent;
-};
-
 export function updateNotifications(notification, intlMessages, intlLocale) {
   return (dispatch, getState) => {
     const showAlert = getState().getIn(['settings', 'notifications', 'alerts', notification.type], true);